summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-10-16 11:51:54 +0200
committerSébastien Helleu <flashcode@flashtux.org>2021-10-17 21:28:31 +0200
commit5546b0af0e24935ce4765372594ed539a96f0fa4 (patch)
tree9461f5bde288f570d7960a80eb48ab41ba23faa3 /src/plugins
parent741343e9aa67acf66b4aef2d42dedcf58414885f (diff)
downloadweechat-5546b0af0e24935ce4765372594ed539a96f0fa4.zip
irc: use parsed command parameters in "344" command callback
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/irc/irc-protocol.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index d752d0089..21d5d5972 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -4865,12 +4865,16 @@ IRC_PROTOCOL_CALLBACK(341)
* Callback for the IRC command "344": channel reop.
*
* Command looks like:
- * :server 344 mynick #channel nick!user@host
+ * 344 mynick #channel nick!user@host
*/
IRC_PROTOCOL_CALLBACK(344)
{
- IRC_PROTOCOL_MIN_ARGS(5);
+ char *str_host;
+
+ IRC_PROTOCOL_MIN_PARAMS(3);
+
+ str_host = irc_protocol_string_params (params, 2, num_params - 1);
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, "reop", NULL),
@@ -4879,10 +4883,13 @@ IRC_PROTOCOL_CALLBACK(344)
_("%sChannel reop %s%s%s: %s%s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
- argv[3],
+ params[1],
IRC_COLOR_RESET,
IRC_COLOR_CHAT_HOST,
- (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]);
+ str_host);
+
+ if (str_host)
+ free (str_host);
return WEECHAT_RC_OK;
}