diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-11 00:42:53 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-17 21:28:31 +0200 |
commit | 2bd3681eefd1b5898c56e1a72b25e148f846a9f3 (patch) | |
tree | 0aeef2886c3190c56e30c19d7f8131ec5e89a2c2 /src/plugins/irc/irc-protocol.c | |
parent | 604415e19e6475b128a8084669744658ee3c49f9 (diff) | |
download | weechat-2bd3681eefd1b5898c56e1a72b25e148f846a9f3.zip |
irc: use parsed command parameters in "kill" command callback
Diffstat (limited to 'src/plugins/irc/irc-protocol.c')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 4c6a6f3cf..5f3991f1a 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -1718,26 +1718,26 @@ IRC_PROTOCOL_CALLBACK(kick) * Callback for the IRC command "KILL". * * Command looks like: - * :nick1!user@host KILL mynick :kill reason + * KILL nick :kill reason */ IRC_PROTOCOL_CALLBACK(kill) { - char *pos_comment; + const char *pos_comment; struct t_irc_channel *ptr_channel; struct t_irc_nick *ptr_nick, *ptr_nick_killed; - IRC_PROTOCOL_MIN_ARGS(3); - IRC_PROTOCOL_CHECK_HOST; + IRC_PROTOCOL_MIN_PARAMS(1); + IRC_PROTOCOL_CHECK_NICK; + IRC_PROTOCOL_CHECK_ADDRESS; - pos_comment = (argc > 3) ? - ((argv_eol[3][0] == ':') ? argv_eol[3] + 1 : argv_eol[3]) : NULL; + pos_comment = (num_params > 1) ? params[1] : NULL; for (ptr_channel = server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel) { ptr_nick = irc_nick_search (server, ptr_channel, nick); - ptr_nick_killed = irc_nick_search (server, ptr_channel, argv[2]); + ptr_nick_killed = irc_nick_search (server, ptr_channel, params[0]); if (pos_comment) { @@ -1772,7 +1772,7 @@ IRC_PROTOCOL_CALLBACK(kill) IRC_COLOR_MESSAGE_KICK); } - if (irc_server_strcasecmp (server, argv[2], server->nick) == 0) + if (irc_server_strcasecmp (server, params[0], server->nick) == 0) { /* * my nick was killed => free all nicks, channel is not active any |