diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-16 13:22:09 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-17 21:28:31 +0200 |
commit | 9b17f1fee4845d66cf1f6648a13506eb2f0010d8 (patch) | |
tree | 711bb062b70b927ef40631216bffba3822ffa349 /src/plugins/irc | |
parent | cee4bf7e3ca583c7f837366fcb885253b039539d (diff) | |
download | weechat-9b17f1fee4845d66cf1f6648a13506eb2f0010d8.zip |
irc: use parsed command parameters in "351" command callback
Diffstat (limited to 'src/plugins/irc')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 5748df3c2..5fcb5527f 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -5279,29 +5279,33 @@ IRC_PROTOCOL_CALLBACK(349) * Callback for the IRC command "351": server version. * * Command looks like: - * :server 351 mynick dancer-ircd-1.0.36(2006/07/23_13:11:50). server :iMZ dncrTS/v4 + * 351 mynick dancer-ircd-1.0.36(2006/07/23_13:11:50). server :iMZ dncrTS/v4 */ IRC_PROTOCOL_CALLBACK(351) { + char *str_params; struct t_gui_buffer *ptr_buffer; - IRC_PROTOCOL_MIN_ARGS(5); + IRC_PROTOCOL_MIN_PARAMS(3); ptr_buffer = irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL); - if (argc > 5) + if (num_params > 3) { + str_params = irc_protocol_string_params (params, 3, num_params - 1); weechat_printf_date_tags ( ptr_buffer, date, irc_protocol_tags (command, "irc_numeric", NULL, NULL), "%s%s %s (%s)", weechat_prefix ("network"), - argv[3], - argv[4], - (argv_eol[5][0] == ':') ? argv_eol[5] + 1 : argv_eol[5]); + params[1], + params[2], + str_params); + if (str_params) + free (str_params); } else { @@ -5311,8 +5315,8 @@ IRC_PROTOCOL_CALLBACK(351) irc_protocol_tags (command, "irc_numeric", NULL, NULL), "%s%s %s", weechat_prefix ("network"), - argv[3], - argv[4]); + params[1], + params[2]); } return WEECHAT_RC_OK; |