diff options
Diffstat (limited to 'src/plugins/charset')
-rw-r--r-- | src/plugins/charset/weechat-charset.c | 17 |
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); + } + } } } } |