summaryrefslogtreecommitdiff
path: root/src/plugins/charset
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2007-03-25 14:13:21 +0000
committerSebastien Helleu <flashcode@flashtux.org>2007-03-25 14:13:21 +0000
commitcd3f62d37e3f4e31729320f29fed9ed153f2e0e2 (patch)
tree40f7668652e900780924802c855626be2c354a5b /src/plugins/charset
parent17989f8d71be175ac9b5c693934ec53f3620eeaa (diff)
downloadweechat-cd3f62d37e3f4e31729320f29fed9ed153f2e0e2.zip
Fixed topic charset, now using channel charset if defined (bug #19386)
Diffstat (limited to 'src/plugins/charset')
-rw-r--r--src/plugins/charset/weechat-charset.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/plugins/charset/weechat-charset.c b/src/plugins/charset/weechat-charset.c
index ed85e3175..0941d6ecd 100644
--- a/src/plugins/charset/weechat-charset.c
+++ b/src/plugins/charset/weechat-charset.c
@@ -192,7 +192,7 @@ void
weechat_charset_parse_irc_msg (char *message, char **nick, char **command,
char **channel, char **pos_args)
{
- char *pos, *pos2, *pos3, *pos_tmp;
+ char *pos, *pos2, *pos3, *pos4, *pos_tmp;
*nick = NULL;
*command = NULL;
@@ -258,6 +258,21 @@ weechat_charset_parse_irc_msg (char *message, char **nick, char **command,
else
*nick = strdup (pos2);
}
+ if (pos3)
+ {
+ pos3++;
+ while (pos3[0] == ' ')
+ pos3++;
+ if ((pos3[0] == '#') || (pos3[0] == '&')
+ || (pos3[0] == '+') || (pos3[0] == '!'))
+ {
+ pos4 = strchr (pos3, ' ');
+ if (pos4)
+ *channel = weechat_charset_strndup (pos3, pos4 - pos3);
+ else
+ *channel = strdup (pos3);
+ }
+ }
}
}
}