From a1a4f337ff3d3d592640c8e0696d2e20f9d07445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 16 Oct 2021 09:34:08 +0200 Subject: irc: use parsed command parameters in "315" command callback --- src/plugins/irc/irc-protocol.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') 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; -- cgit v1.2.3