diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-09-21 20:41:18 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-09-21 20:41:18 +0200 |
commit | edd1971ae87222a28749b2f2dee490f0175d2baa (patch) | |
tree | dcf1178c15c46a6da5ba901fbf81dea4bedfcd8e | |
parent | a6826af796c2809681dec21e7d9dcbd9896ffe42 (diff) | |
download | weechat-edd1971ae87222a28749b2f2dee490f0175d2baa.zip |
irc: fix parsing of TAGMSG message when there is a colon before the channel
This fixes the display of typing notifications on some IRC servers like
inspircd.
-rw-r--r-- | ChangeLog.adoc | 4 | ||||
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 10 |
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index a57de7dc5..3987fe3f0 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -22,6 +22,10 @@ New features:: * api: add user variables in evaluation of expressions with "define:name,value" +Bug fixes:: + + * irc: fix parsing of TAGMSG message when there is a colon before the channel + [[v3.3]] == Version 3.3 (2021-09-19) diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 808f14f31..624a126df 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -2978,12 +2978,14 @@ IRC_PROTOCOL_CALLBACK(setname) * * Message looks like: * @msgid=6gqz7dxd22v7r3x9pvu;+typing=active :nick!user@host TAGMSG #channel + * @msgid=6gqz7dxd22v7r3x9pvu;+typing=active :nick!user@host TAGMSG :#channel */ IRC_PROTOCOL_CALLBACK(tagmsg) { struct t_irc_channel *ptr_channel; const char *ptr_typing_value; + char *pos_channel; int state; IRC_PROTOCOL_MIN_ARGS(3); @@ -2994,10 +2996,12 @@ IRC_PROTOCOL_CALLBACK(tagmsg) if (!tags) return WEECHAT_RC_OK; + pos_channel = (argv[2][0] == ':') ? argv[2] + 1 : argv[2]; + ptr_channel = NULL; - if (irc_channel_is_channel (server, argv[2])) - ptr_channel = irc_channel_search (server, argv[2]); - else if (irc_server_strcasecmp (server, argv[2], server->nick) == 0) + if (irc_channel_is_channel (server, pos_channel)) + ptr_channel = irc_channel_search (server, pos_channel); + else if (irc_server_strcasecmp (server, pos_channel, server->nick) == 0) ptr_channel = irc_channel_search (server, nick); if (!ptr_channel) return WEECHAT_RC_OK; |