summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2021-10-15 21:05:54 +0200
committerSébastien Helleu <flashcode@flashtux.org>2021-10-17 21:28:31 +0200
commitefecdf5d450d83ff3a5eb7256791d3d70c87fd1b (patch)
tree67f07f389d6f97aa6243faedb2e1e869ee4b4014 /src/plugins
parent76b75ad5cdcd3cd418f2b2d4d09e7bb3043f8cd3 (diff)
downloadweechat-efecdf5d450d83ff3a5eb7256791d3d70c87fd1b.zip
irc: use parsed command parameters in "303" command callback
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/irc/irc-protocol.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index ab4a3dd1e..616f00e44 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -3769,12 +3769,16 @@ IRC_PROTOCOL_CALLBACK(301)
* Callback for the IRC command "303": ison.
*
* Command looks like:
- * :server 303 mynick :nick1 nick2
+ * 303 mynick :nick1 nick2
*/
IRC_PROTOCOL_CALLBACK(303)
{
- IRC_PROTOCOL_MIN_ARGS(4);
+ char *str_params;
+
+ IRC_PROTOCOL_MIN_PARAMS(2);
+
+ str_params = irc_protocol_string_params (params, 1, num_params - 1);
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL),
@@ -3783,7 +3787,10 @@ IRC_PROTOCOL_CALLBACK(303)
_("%sUsers online: %s%s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_NICK,
- (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3]);
+ str_params);
+
+ if (str_params)
+ free (str_params);
return WEECHAT_RC_OK;
}