Legend:
- Unmodified
- Added
- Removed
-
irc_im.c
r459dec8 rdf701918 342 342 } 343 343 344 static gboolean bee_irc_user_nick_update(irc_user_t *iu );344 static gboolean bee_irc_user_nick_update(irc_user_t *iu, gboolean offline_only); 345 345 346 346 static gboolean bee_irc_user_fullname(bee_t *bee, bee_user_t *bu) … … 370 370 } 371 371 372 bee_irc_user_nick_update(iu );372 bee_irc_user_nick_update(iu, TRUE); 373 373 374 374 return TRUE; … … 377 377 static gboolean bee_irc_user_nick_hint(bee_t *bee, bee_user_t *bu, const char *hint) 378 378 { 379 bee_irc_user_nick_update((irc_user_t *) bu->ui_data); 379 bee_irc_user_nick_update((irc_user_t *) bu->ui_data, TRUE); 380 381 return TRUE; 382 } 383 384 static gboolean bee_irc_user_nick_change(bee_t *bee, bee_user_t *bu, const char *nick) 385 { 386 bee_irc_user_nick_update((irc_user_t *) bu->ui_data, FALSE); 380 387 381 388 return TRUE; … … 388 395 bee_user_flags_t online; 389 396 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 }394 395 397 bee_irc_channel_update(irc, NULL, iu); 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) 398 bee_irc_user_nick_update(iu, FALSE); 399 400 return TRUE; 401 } 402 403 static gboolean bee_irc_user_nick_update(irc_user_t *iu, gboolean offline_only) 407 404 { 408 405 bee_user_t *bu = iu->bu; 409 406 char *newnick; 410 407 411 if ( bu->flags & BEE_USER_ONLINE) {408 if (offline_only && bu->flags & BEE_USER_ONLINE) { 412 409 /* Ignore if the user is visible already. */ 413 410 return TRUE; … … 432 429 { 433 430 bee_user_t *bu = iu->bu; 434 bee_user_flags_t online;435 431 436 432 if (bu == FALSE) { … … 438 434 } 439 435 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 445 436 nick_del(bu); 446 bee_irc_user_nick_update(iu); 447 448 bu->flags |= online; 437 bee_irc_user_nick_update(iu, FALSE); 438 449 439 } 450 440 … … 1146 1136 1147 1137 bee_irc_log, 1138 bee_irc_user_nick_change, 1148 1139 };
Note: See TracChangeset
for help on using the changeset viewer.