diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-12-17 13:39:11 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-12-17 13:39:11 +0100 |
commit | e3b26523a74fb889d33ffc5badc1aa63990d90ed (patch) | |
tree | f861a356901c2cdf54e343a15ba9123743f39fed /src/plugins/irc | |
parent | 4901cd814591672165f318a87315bd4c47da2cf3 (diff) | |
download | weechat-e3b26523a74fb889d33ffc5badc1aa63990d90ed.zip |
Fix bugs in IRC message parser and use of decoding charset for server messages
Diffstat (limited to 'src/plugins/irc')
-rw-r--r-- | src/plugins/irc/irc-server.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index e87b4685b..ba5605e4a 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -1200,7 +1200,7 @@ irc_server_parse_message (const char *message, char **nick, char **host, { pos2 = strchr (message, '!'); pos = strchr (message, ' '); - if (pos2) + if (pos2 && (!pos || pos > pos2)) { if (nick) *nick = weechat_strndup (message + 1, pos2 - (message + 1)); @@ -1670,11 +1670,22 @@ irc_server_msgq_flush () ptr_chan_nick = (channel) ? channel : nick; if (ptr_chan_nick) { - snprintf (modifier_data, sizeof (modifier_data), - "%s.%s.%s", - weechat_plugin->name, - irc_recv_msgq->server->name, - ptr_chan_nick); + /* message with no target (nick or channel) ? */ + if (nick && host && (strcmp (nick, host) == 0)) + { + snprintf (modifier_data, sizeof (modifier_data), + "%s.server.%s", + weechat_plugin->name, + irc_recv_msgq->server->name); + } + else + { + snprintf (modifier_data, sizeof (modifier_data), + "%s.%s.%s", + weechat_plugin->name, + irc_recv_msgq->server->name, + ptr_chan_nick); + } } else { |