From 80c2f3c775d7a7dd5a59068f1cefe55370f56529 Mon Sep 17 00:00:00 2001 From: dequis Date: Fri, 20 Nov 2015 12:33:34 -0300 Subject: IRCv3 away-notify capability Neat lightweight notifications of the awayness of contacts. In practice, this means weechat/hexchat users can see away people in their nick list and change show_users to 'online,special,away' to avoid the mode spam completely. These are also sent on online/offline changes, since offline_user_quits can be turned off, and you'd need something when they come back. --- irc_im.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'irc_im.c') diff --git a/irc_im.c b/irc_im.c index a66b72a2..587821c5 100644 --- a/irc_im.c +++ b/irc_im.c @@ -119,6 +119,12 @@ static gboolean bee_irc_user_status(bee_t *bee, bee_user_t *bu, bee_user_t *old) iu->flags |= IRC_USER_AWAY; } + 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))) { + irc_send_away_notify(iu); + } + if ((bu->flags & BEE_USER_ONLINE) != (old->flags & BEE_USER_ONLINE)) { if (bu->flags & BEE_USER_ONLINE) { if (g_hash_table_lookup(irc->watches, iu->key)) { -- cgit v1.2.3