Changes in irc_im.c [30093fa:03df717]
Legend:
- Unmodified
- Added
- Removed
-
irc_im.c
r30093fa r03df717 120 120 } 121 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); 126 } 127 122 128 if ((bu->flags & BEE_USER_ONLINE) != (old->flags & BEE_USER_ONLINE)) { 123 129 if (bu->flags & BEE_USER_ONLINE) { … … 147 153 148 154 bee_irc_channel_update(irc, NULL, iu); 149 150 /* If away-notify enabled, send status updates when:151 * Away or Online state changes152 * Status changes (e.g. "Away" to "Mobile")153 * Status message changes154 */155 if ((irc->caps & CAP_AWAY_NOTIFY) &&156 ((bu->flags & BEE_USER_AWAY) != (old->flags & BEE_USER_AWAY) ||157 (bu->flags & BEE_USER_ONLINE) != (old->flags & BEE_USER_ONLINE) ||158 (g_strcmp0(bu->status, old->status) != 0) ||159 (g_strcmp0(bu->status_msg, old->status_msg) != 0))) {160 irc_send_away_notify(iu);161 }162 155 163 156 return TRUE; … … 299 292 } 300 293 301 wrapped = word_wrap(msg, IRC_WORD_WRAP);294 wrapped = word_wrap(msg, 425); 302 295 irc_send_msg(src_iu, message_type, dst, wrapped, prefix); 303 296 g_free(wrapped); … … 349 342 } 350 343 351 static gboolean bee_irc_user_nick_update(irc_user_t *iu , gboolean offline_only);344 static gboolean bee_irc_user_nick_update(irc_user_t *iu); 352 345 353 346 static gboolean bee_irc_user_fullname(bee_t *bee, bee_user_t *bu) … … 377 370 } 378 371 379 bee_irc_user_nick_update(iu , TRUE);372 bee_irc_user_nick_update(iu); 380 373 381 374 return TRUE; … … 384 377 static gboolean bee_irc_user_nick_hint(bee_t *bee, bee_user_t *bu, const char *hint) 385 378 { 386 bee_irc_user_nick_update((irc_user_t *) bu->ui_data, TRUE); 387 388 return TRUE; 389 } 390 391 static gboolean bee_irc_user_nick_change(bee_t *bee, bee_user_t *bu, const char *nick) 392 { 393 bee_irc_user_nick_update((irc_user_t *) bu->ui_data, FALSE); 379 bee_irc_user_nick_update((irc_user_t *) bu->ui_data); 394 380 395 381 return TRUE; … … 400 386 irc_user_t *iu = (irc_user_t *) bu->ui_data; 401 387 irc_t *irc = (irc_t *) bee->ui_data; 388 bee_user_flags_t online; 389 390 /* Take the user offline temporarily so we can change the nick (if necessary). */ 391 if ((online = bu->flags & BEE_USER_ONLINE)) { 392 bu->flags &= ~BEE_USER_ONLINE; 393 } 402 394 403 395 bee_irc_channel_update(irc, NULL, iu); 404 bee_irc_user_nick_update(iu, FALSE); 405 406 return TRUE; 407 } 408 409 static gboolean bee_irc_user_nick_update(irc_user_t *iu, gboolean offline_only) 396 bee_irc_user_nick_update(iu); 397 398 if (online) { 399 bu->flags |= online; 400 bee_irc_channel_update(irc, NULL, iu); 401 } 402 403 return TRUE; 404 } 405 406 static gboolean bee_irc_user_nick_update(irc_user_t *iu) 410 407 { 411 408 bee_user_t *bu = iu->bu; 412 409 char *newnick; 413 410 414 if ( offline_only &&bu->flags & BEE_USER_ONLINE) {411 if (bu->flags & BEE_USER_ONLINE) { 415 412 /* Ignore if the user is visible already. */ 416 413 return TRUE; … … 435 432 { 436 433 bee_user_t *bu = iu->bu; 434 bee_user_flags_t online; 437 435 438 436 if (bu == FALSE) { … … 440 438 } 441 439 440 /* In this case, pretend the user is offline. */ 441 if ((online = bu->flags & BEE_USER_ONLINE)) { 442 bu->flags &= ~BEE_USER_ONLINE; 443 } 444 442 445 nick_del(bu); 443 bee_irc_user_nick_update(iu, FALSE); 444 446 bee_irc_user_nick_update(iu); 447 448 bu->flags |= online; 445 449 } 446 450 … … 457 461 } 458 462 459 if (iu->last_channel == NULL && 460 (away = irc_user_get_away(iu)) && 463 if ((away = irc_user_get_away(iu)) && 461 464 time(NULL) >= iu->away_reply_timeout) { 462 465 irc_send_num(iu->irc, 301, "%s :%s", iu->nick, away); … … 673 676 } 674 677 675 wrapped = word_wrap(msg, IRC_WORD_WRAP);678 wrapped = word_wrap(msg, 425); 676 679 irc_send_msg(iu, "PRIVMSG", ic->name, wrapped, ts); 677 680 g_free(ts); … … 1143 1146 1144 1147 bee_irc_log, 1145 bee_irc_user_nick_change,1146 1148 };
Note: See TracChangeset
for help on using the changeset viewer.