summaryrefslogtreecommitdiff
path: root/src/plugins/irc
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-10-16 11:56:03 +0200
committerSébastien Helleu <flashcode@flashtux.org>2021-10-17 21:28:31 +0200
commit99d565f6df803dd4feb0ca2b4bcbcaeac2fe7ea3 (patch)
tree3ba04ad2b045f478cdaae49ba17838c8b505c00c /src/plugins/irc
parent5546b0af0e24935ce4765372594ed539a96f0fa4 (diff)
downloadweechat-99d565f6df803dd4feb0ca2b4bcbcaeac2fe7ea3.zip
irc: use parsed command parameters in "345" command callback
Diffstat (limited to 'src/plugins/irc')
-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 21d5d5972..df08e5664 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -4898,12 +4898,16 @@ IRC_PROTOCOL_CALLBACK(344)
* Callback for the IRC command "345": end of channel reop.
*
* Command looks like:
- * :server 345 mynick #channel :End of Channel Reop List
+ * 345 mynick #channel :End of Channel Reop List
*/
IRC_PROTOCOL_CALLBACK(345)
{
- IRC_PROTOCOL_MIN_ARGS(5);
+ char *str_params;
+
+ IRC_PROTOCOL_MIN_PARAMS(3);
+
+ str_params = irc_protocol_string_params (params, 2, num_params - 1);
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, "reop", NULL),
@@ -4912,9 +4916,12 @@ IRC_PROTOCOL_CALLBACK(345)
"%s%s%s%s: %s",
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
- argv[3],
+ params[1],
IRC_COLOR_RESET,
- (argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]);
+ str_params);
+
+ if (str_params)
+ free (str_params);
return WEECHAT_RC_OK;
}