diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-16 13:11:54 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-17 21:28:31 +0200 |
commit | cee4bf7e3ca583c7f837366fcb885253b039539d (patch) | |
tree | d7dadd4b91c218c97106bee1e9a0c3bdbc7a8e4a /src/plugins/irc | |
parent | 027ecc6b0ec9c2665ba779c0d8cf30a31080f23b (diff) | |
download | weechat-cee4bf7e3ca583c7f837366fcb885253b039539d.zip |
irc: use parsed command parameters in "349" command callback
Diffstat (limited to 'src/plugins/irc')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 9bf3db9a0..5748df3c2 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -5223,22 +5223,22 @@ IRC_PROTOCOL_CALLBACK(348) * Callback for the IRC command "349": end of channel exception list. * * Command looks like: - * :server 349 mynick #channel :End of Channel Exception List + * 349 mynick #channel :End of Channel Exception List */ IRC_PROTOCOL_CALLBACK(349) { - char *pos_args; + char *str_params; struct t_irc_channel *ptr_channel; struct t_gui_buffer *ptr_buffer; struct t_irc_modelist *ptr_modelist; - IRC_PROTOCOL_MIN_ARGS(4); + IRC_PROTOCOL_MIN_PARAMS(2); - pos_args = (argc > 4) ? - ((argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]) : NULL; + str_params = (num_params > 2) ? + irc_protocol_string_params (params, 2, num_params - 1) : NULL; - ptr_channel = irc_channel_search (server, argv[3]); + ptr_channel = irc_channel_search (server, params[1]); ptr_buffer = (ptr_channel && ptr_channel->nicks) ? ptr_channel->buffer : server->buffer; ptr_modelist = irc_modelist_search (ptr_channel, 'e'); @@ -5263,11 +5263,14 @@ IRC_PROTOCOL_CALLBACK(349) weechat_prefix ("network"), IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_CHAT_CHANNEL, - argv[3], + params[1], IRC_COLOR_CHAT_DELIMITERS, IRC_COLOR_RESET, - (pos_args) ? " " : "", - (pos_args) ? pos_args : ""); + (str_params) ? " " : "", + (str_params) ? str_params : ""); + + if (str_params) + free (str_params); return WEECHAT_RC_OK; } |