summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-10-16 09:34:08 +0200
committerSébastien Helleu <flashcode@flashtux.org>2021-10-17 21:28:31 +0200
commita1a4f337ff3d3d592640c8e0696d2e20f9d07445 (patch)
tree54ae6439ce3531fe869a01fe83f9018373eb7a0e /src
parente412a34668a64990a006941984ce8fe1f3de5af7 (diff)
downloadweechat-a1a4f337ff3d3d592640c8e0696d2e20f9d07445.zip
irc: use parsed command parameters in "315" command callback
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-protocol.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index b982f9d75..3f27121f9 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -4058,22 +4058,24 @@ IRC_PROTOCOL_CALLBACK(314)
* Callback for the IRC command "315": end of /who.
*
* Command looks like:
- * :server 315 mynick #channel :End of /WHO list.
+ * 315 mynick #channel :End of /WHO list.
*/
IRC_PROTOCOL_CALLBACK(315)
{
+ char *str_params;
struct t_irc_channel *ptr_channel;
- IRC_PROTOCOL_MIN_ARGS(5);
+ IRC_PROTOCOL_MIN_PARAMS(3);
- ptr_channel = irc_channel_search (server, argv[3]);
+ ptr_channel = irc_channel_search (server, params[1]);
if (ptr_channel && (ptr_channel->checking_whox > 0))
{
ptr_channel->checking_whox--;
}
else
{
+ str_params = irc_protocol_string_params (params, 2, num_params - 1);
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (
server, NULL, command, "who", NULL),
@@ -4083,10 +4085,12 @@ IRC_PROTOCOL_CALLBACK(315)
weechat_prefix ("network"),
IRC_COLOR_CHAT_DELIMITERS,
IRC_COLOR_CHAT_CHANNEL,
- argv[3],
+ params[1],
IRC_COLOR_CHAT_DELIMITERS,
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;