From f892236adc18544c0ff424a18e21f98c5962ce12 Mon Sep 17 00:00:00 2001 From: Shane Synan Date: Mon, 29 Feb 2016 15:24:01 -0600 Subject: Send new away message when message changes Send new away message when away-notify is enabled and the status changes (e.g. "Away" to "Mobile") or the status message changes without returning from away. Fixes IRC clients with away-notify persisting old away messages. --- irc_im.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/irc_im.c b/irc_im.c index 080ecb7f..87b5262e 100644 --- a/irc_im.c +++ b/irc_im.c @@ -147,9 +147,16 @@ static gboolean bee_irc_user_status(bee_t *bee, bee_user_t *bu, bee_user_t *old) bee_irc_channel_update(irc, NULL, iu); + /* If away-notify enabled, send status updates when: + * Away or Online state changes + * Status changes (e.g. "Away" to "Mobile") + * Status message changes + */ if ((irc->caps & CAP_AWAY_NOTIFY) && ((bu->flags & BEE_USER_AWAY) != (old->flags & BEE_USER_AWAY) || - (bu->flags & BEE_USER_ONLINE) != (old->flags & BEE_USER_ONLINE))) { + (bu->flags & BEE_USER_ONLINE) != (old->flags & BEE_USER_ONLINE) || + (g_strcmp0(bu->status, old->status) != 0) || + (g_strcmp0(bu->status_msg, old->status_msg) != 0))) { irc_send_away_notify(iu); } -- cgit v1.2.3