diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-10 21:40:33 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-10-17 21:28:31 +0200 |
commit | 15392e4a81078c526f1f0ff687860ac6dbb3e6c2 (patch) | |
tree | 27ac5ef89790b1117ef0fffc1d63901ff08eee3c /src | |
parent | cb856a7f3a3ff1b720fc279d5934fa6c06652d3f (diff) | |
download | weechat-15392e4a81078c526f1f0ff687860ac6dbb3e6c2.zip |
irc: use parsed command parameters in "away" command callback
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index aacb44f4f..a740d253f 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -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; |