summaryrefslogtreecommitdiff
path: root/src/plugins/irc
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2018-04-02 10:36:36 +0200
committerSébastien Helleu <flashcode@flashtux.org>2018-04-02 10:36:36 +0200
commit70a930516d822b5630dc77e32dc9d034ade5cc2e (patch)
treebe9d12530a541a0a4f4051d49637395f73116524 /src/plugins/irc
parent8fd2a909b40e3b192bc1ea8de3c03a30cf07999a (diff)
downloadweechat-70a930516d822b5630dc77e32dc9d034ade5cc2e.zip
irc: always set nick away status on WHO response (sent manually or automatically with server option "away_check")
Diffstat (limited to 'src/plugins/irc')
-rw-r--r--src/plugins/irc/irc-nick.c15
-rw-r--r--src/plugins/irc/irc-protocol.c18
2 files changed, 6 insertions, 27 deletions
diff --git a/src/plugins/irc/irc-nick.c b/src/plugins/irc/irc-nick.c
index 3d33c2dab..22e89da26 100644
--- a/src/plugins/irc/irc-nick.c
+++ b/src/plugins/irc/irc-nick.c
@@ -749,18 +749,11 @@ void
irc_nick_set_away (struct t_irc_server *server, struct t_irc_channel *channel,
struct t_irc_nick *nick, int is_away)
{
- if (!is_away
- || server->cap_away_notify
- || ((IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_AWAY_CHECK) > 0)
- && ((IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_AWAY_CHECK_MAX_NICKS) == 0)
- || (channel->nicks_count <= IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_AWAY_CHECK_MAX_NICKS)))))
+ if (is_away != nick->away)
{
- if ((is_away && !nick->away) || (!is_away && nick->away))
- {
- nick->away = is_away;
- irc_nick_nicklist_set (channel, nick, "color",
- irc_nick_get_color_for_nicklist (server, nick));
- }
+ nick->away = is_away;
+ irc_nick_nicklist_set (channel, nick, "color",
+ irc_nick_get_color_for_nicklist (server, nick));
}
}
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 5e27f7dba..be9f62f51 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -4555,22 +4555,8 @@ IRC_PROTOCOL_CALLBACK(354)
/* update away flag in nick */
if (ptr_channel && ptr_nick)
{
- if (pos_attr
- && (server->cap_away_notify
- || ((IRC_SERVER_OPTION_INTEGER(
- server, IRC_SERVER_OPTION_AWAY_CHECK) > 0)
- && ((IRC_SERVER_OPTION_INTEGER(
- server, IRC_SERVER_OPTION_AWAY_CHECK_MAX_NICKS) == 0)
- || (ptr_channel->nicks_count <= IRC_SERVER_OPTION_INTEGER(
- server, IRC_SERVER_OPTION_AWAY_CHECK_MAX_NICKS))))))
- {
- irc_nick_set_away (server, ptr_channel, ptr_nick,
- (pos_attr[0] == 'G') ? 1 : 0);
- }
- else
- {
- irc_nick_set_away (server, ptr_channel, ptr_nick, 0);
- }
+ irc_nick_set_away (server, ptr_channel, ptr_nick,
+ (pos_attr && (pos_attr[0] == 'G')) ? 1 : 0);
}
/* update account flag in nick */