aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShane Synan <digitalcircuit36939@gmail.com>2016-01-31 23:10:47 -0600
committerShane Synan <digitalcircuit36939@gmail.com>2016-01-31 23:10:47 -0600
commitdb5ef3a204c3a518adb7cedde0ffb067d6336add (patch)
treea5b548b07177ac4f4e9c30797e858e43a2f000b4
parent7616eec826025932d1a2a62fc6f71887995046e0 (diff)
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
-rw-r--r--irc_send.c9
1 files changed, 7 insertions, 2 deletions
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,