diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-15 19:17:53 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-17 21:28:31 +0200 |
commit | 5389ceb237874ed8c7ce47f4c6312a9bc5bc531e (patch) | |
tree | e979e7d6e71e7f3694241018e07a211ebf3e20ba /src/plugins | |
parent | 03e01221557cc60bc1a25e8b18f167e6b1319557 (diff) | |
download | weechat-5389ceb237874ed8c7ce47f4c6312a9bc5bc531e.zip |
irc: use parsed command parameters in "tagmsg" command callback
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index f451977f2..07d290568 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -3043,7 +3043,7 @@ IRC_PROTOCOL_CALLBACK(setname) * Callback for the IRC command "TAGMSG": message with tags but no text content * (received when capability "message-tags" is enabled). * - * Command looks like: + * Whole message looks like: * @msgid=6gqz7dxd22v7r3x9pvu;+typing=active :nick!user@host TAGMSG #channel * @msgid=6gqz7dxd22v7r3x9pvu;+typing=active :nick!user@host TAGMSG :#channel */ @@ -3052,10 +3052,9 @@ 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); + IRC_PROTOCOL_MIN_PARAMS(1); if (ignored) return WEECHAT_RC_OK; @@ -3063,12 +3062,10 @@ 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, pos_channel)) - ptr_channel = irc_channel_search (server, pos_channel); - else if (irc_server_strcasecmp (server, pos_channel, server->nick) == 0) + if (irc_channel_is_channel (server, params[0])) + ptr_channel = irc_channel_search (server, params[0]); + else if (irc_server_strcasecmp (server, params[0], server->nick) == 0) ptr_channel = irc_channel_search (server, nick); if (!ptr_channel) return WEECHAT_RC_OK; |