Changeset 80c2f3c
- Timestamp:
- 2015-11-20T15:51:45Z (9 years ago)
- 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)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.h
r0d8a9bb0 r80c2f3c 71 71 CAP_MULTI_PREFIX = (1 << 1), 72 72 CAP_EXTENDED_JOIN = (1 << 2), 73 CAP_AWAY_NOTIFY = (1 << 3), 73 74 } irc_cap_flag_t; 74 75 … … 342 343 void irc_send_invite(irc_user_t *iu, irc_channel_t *ic); 343 344 void irc_send_cap(irc_t *irc, char *subcommand, char *body); 345 void irc_send_away_notify(irc_user_t *iu); 344 346 345 347 /* irc_user.c */ -
irc_cap.c
r0d8a9bb0 r80c2f3c 41 41 {"multi-prefix", CAP_MULTI_PREFIX}, 42 42 {"extended-join", CAP_EXTENDED_JOIN}, 43 {"away-notify", CAP_AWAY_NOTIFY}, 43 44 {NULL}, 44 45 }; -
irc_im.c
r0d8a9bb0 r80c2f3c 118 118 if (bu->flags & BEE_USER_AWAY || !(bu->flags & BEE_USER_ONLINE)) { 119 119 iu->flags |= IRC_USER_AWAY; 120 } 121 122 if ((irc->caps & CAP_AWAY_NOTIFY) && 123 ((bu->flags & BEE_USER_AWAY) != (old->flags & BEE_USER_AWAY) || 124 (bu->flags & BEE_USER_ONLINE) != (old->flags & BEE_USER_ONLINE))) { 125 irc_send_away_notify(iu); 120 126 } 121 127 -
irc_send.c
r0d8a9bb0 r80c2f3c 470 470 irc_write(irc, ":%s CAP %s %s :%s", irc->root->host, nick, subcommand, body); 471 471 } 472 473 void 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.