Changeset 80c2f3c for irc_send.c


Ignore:
Timestamp:
2015-11-20T15:51:45Z (5 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
8fdeaa5
Parents:
0d8a9bb0
git-author:
dequis <dx@…> (20-11-15 15:33:34)
git-committer:
dequis <dx@…> (20-11-15 15:51:45)
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_send.c

    r0d8a9bb0 r80c2f3c  
    470470        irc_write(irc, ":%s CAP %s %s :%s", irc->root->host, nick, subcommand, body);
    471471}
     472
     473void irc_send_away_notify(irc_user_t *iu)
     474{
     475        bee_user_t *bu = iu->bu;
     476
     477        if (!bu) {
     478                return;
     479        }
     480
     481        if (bu->flags & BEE_USER_AWAY || !(bu->flags & BEE_USER_ONLINE)) {
     482                char *msg1, *msg2;
     483
     484                get_status_message(bu, &msg1, &msg2);
     485
     486                if (msg2) {
     487                        irc_write(iu->irc, ":%s!%s@%s AWAY :%s (%s)", iu->nick, iu->user, iu->host, msg1, msg2);
     488                } else {
     489                        irc_write(iu->irc, ":%s!%s@%s AWAY :%s", iu->nick, iu->user, iu->host, msg1);
     490                }
     491        } else {
     492                irc_write(iu->irc, ":%s!%s@%s AWAY", iu->nick, iu->user, iu->host);
     493        }
     494}
     495
Note: See TracChangeset for help on using the changeset viewer.