From db5ef3a204c3a518adb7cedde0ffb067d6336add Mon Sep 17 00:00:00 2001 From: Shane Synan Date: Sun, 31 Jan 2016 23:10:47 -0600 Subject: Check global account away setting in WHO replies When sending WHO reply, check if irc_user is the account user and if so set away status according to global account away configuration. Otherwise, reply according to irc_user flags. Fixes global away status not being shown in IRC clients when WHO polling is enabled. Fixes: https://bugs.bitlbee.org/ticket/1247 --- irc_send.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'irc_send.c') diff --git a/irc_send.c b/irc_send.c index 4511d667..adf8211e 100644 --- a/irc_send.c +++ b/irc_send.c @@ -347,8 +347,13 @@ void irc_send_who(irc_t *irc, GSList *l, const char *channel) iu = l->data; } - /* rfc1459 doesn't mention this: G means gone, H means here */ - status_prefix[0] = iu->flags & IRC_USER_AWAY ? 'G' : 'H'; + /* If this is the account nick, check configuration to see if away */ + if (iu == irc->user) { + /* rfc1459 doesn't mention this: G means gone, H means here */ + status_prefix[0] = set_getstr(&irc->b->set, "away") ? 'G' : 'H'; + } else { + status_prefix[0] = iu->flags & IRC_USER_AWAY ? 'G' : 'H'; + } irc_send_num(irc, 352, "%s %s %s %s %s %s :0 %s", is_channel ? channel : "*", iu->user, iu->host, irc->root->host, -- cgit v1.2.3