aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShane Synan <digitalcircuit36939@gmail.com>2016-02-29 15:24:01 -0600
committerdequis <dx@dxzone.com.ar>2016-03-20 00:58:05 -0300
commitf892236adc18544c0ff424a18e21f98c5962ce12 (patch)
treef85943414f61dd54de361a1cd55d173070a43332
parent4e0e5909c201ecce6a927dcda91c3e3e457faa2a (diff)
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.
-rw-r--r--irc_im.c9
1 files changed, 8 insertions, 1 deletions
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);
}