diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-15 19:59:40 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-17 21:28:31 +0200 |
commit | 033fbf63b0a4c7a8e5fecc93cae29eb007c93fc4 (patch) | |
tree | dd8be255f83cb088493a200fd93553d40bfa3aca /src/plugins | |
parent | 1029780ce21d47a8439ef1fb79006d73e668668f (diff) | |
download | weechat-033fbf63b0a4c7a8e5fecc93cae29eb007c93fc4.zip |
irc: use parsed command parameters in "008" command callback
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 487a95758..183d24719 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -3641,23 +3641,30 @@ IRC_PROTOCOL_CALLBACK(005) * Callback for the IRC command "008": server notice mask. * * Command looks like: - * :server 008 nick +Zbfkrsuy :Server notice mask + * 008 nick +Zbfkrsuy :Server notice mask */ IRC_PROTOCOL_CALLBACK(008) { - 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, argv[2], command, NULL, NULL), + irc_msgbuffer_get_target_buffer (server, params[0], command, NULL, NULL), date, irc_protocol_tags (command, "irc_numeric", NULL, address), _("%sServer notice mask for %s%s%s: %s"), weechat_prefix ("network"), - irc_nick_color_for_msg (server, 1, NULL, argv[2]), - argv[2], + irc_nick_color_for_msg (server, 1, NULL, params[0]), + params[0], IRC_COLOR_RESET, - (argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3]); + str_params); + + if (str_params) + free (str_params); return WEECHAT_RC_OK; } |