1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 10:13:12 +02:00

irc: use parsed command parameters in "344" command callback

This commit is contained in:
Sébastien Helleu
2021-10-16 11:51:54 +02:00
parent 741343e9aa
commit 5546b0af0e
2 changed files with 19 additions and 8 deletions
+11 -4
View File
@@ -4865,12 +4865,16 @@ IRC_PROTOCOL_CALLBACK(341)
* Callback for the IRC command "344": channel reop.
*
* Command looks like:
* :server 344 mynick #channel nick!user@host
* 344 mynick #channel nick!user@host
*/
IRC_PROTOCOL_CALLBACK(344)
{
IRC_PROTOCOL_MIN_ARGS(5);
char *str_host;
IRC_PROTOCOL_MIN_PARAMS(3);
str_host = irc_protocol_string_params (params, 2, num_params - 1);
weechat_printf_date_tags (
irc_msgbuffer_get_target_buffer (server, NULL, command, "reop", NULL),
@@ -4879,10 +4883,13 @@ IRC_PROTOCOL_CALLBACK(344)
_("%sChannel reop %s%s%s: %s%s"),
weechat_prefix ("network"),
IRC_COLOR_CHAT_CHANNEL,
argv[3],
params[1],
IRC_COLOR_RESET,
IRC_COLOR_CHAT_HOST,
(argv_eol[4][0] == ':') ? argv_eol[4] + 1 : argv_eol[4]);
str_host);
if (str_host)
free (str_host);
return WEECHAT_RC_OK;
}