1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 14:14:48 +02:00

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

This commit is contained in:
Sébastien Helleu
2021-10-10 21:40:33 +02:00
parent cb856a7f3a
commit 15392e4a81
+7 -4
View File
@@ -484,8 +484,8 @@ IRC_PROTOCOL_CALLBACK(authenticate)
* "away-notify").
*
* Command looks like:
* :nick!user@host AWAY
* :nick!user@host AWAY :I am away
* AWAY
* AWAY :I am away
*/
IRC_PROTOCOL_CALLBACK(away)
@@ -493,14 +493,17 @@ IRC_PROTOCOL_CALLBACK(away)
struct t_irc_channel *ptr_channel;
struct t_irc_nick *ptr_nick;
IRC_PROTOCOL_MIN_ARGS(2);
IRC_PROTOCOL_MIN_PARAMS(0);
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
ptr_nick = irc_nick_search (server, ptr_channel, nick);
if (ptr_nick)
irc_nick_set_away (server, ptr_channel, ptr_nick, (argc > 2));
{
irc_nick_set_away (server, ptr_channel, ptr_nick,
(num_params > 0));
}
}
return WEECHAT_RC_OK;