# HG changeset patch # User Christian Hammond # Date 1074330185 0 # Node ID 52cdf27406545adc3b433efd6427352768890de8 # Parent 9aafd344230d6430b774e388c2efdfd4c76b489a [gaim-migrate @ 8834] I don't think this will cause any problems, but perhaps there's some plugin that relies on this? Doubt it.. Anyhow, we were emitting buddy-away/back/idle/unidle signals before setting the new variables, which didn't let the signal handlers see the new variables. It's possible that a plugin or two out there took advantage of that to access the old values, but if that's something that's important, perhaps we should look into passing them to the signal handlers? committer: Tailor Script diff -r 9aafd344230d -r 52cdf2740654 src/blist.c --- a/src/blist.c Sat Jan 17 07:10:20 2004 +0000 +++ b/src/blist.c Sat Jan 17 09:03:05 2004 +0000 @@ -221,22 +221,23 @@ void gaim_blist_update_buddy_status (GaimBuddy *buddy, int status) { GaimBlistUiOps *ops; + int old_status = buddy->uc; ops = gaimbuddylist->ui_ops; - if (buddy->uc != status) { - if ((status & UC_UNAVAILABLE) != (buddy->uc & UC_UNAVAILABLE)) { + if (old_status != status) { + buddy->uc = status; + gaim_contact_compute_priority_buddy(gaim_buddy_get_contact(buddy)); + + if ((status & UC_UNAVAILABLE) != (old_status & UC_UNAVAILABLE)) { if (status & UC_UNAVAILABLE) gaim_signal_emit(gaim_blist_get_handle(), "buddy-away", buddy); else gaim_signal_emit(gaim_blist_get_handle(), "buddy-back", buddy); } - - buddy->uc = status; - gaim_contact_compute_priority_buddy(gaim_buddy_get_contact(buddy)); } - + if (ops) ops->update(gaimbuddylist, (GaimBlistNode*)buddy); } diff -r 9aafd344230d -r 52cdf2740654 src/server.c --- a/src/server.c Sat Jan 17 07:10:20 2004 +0000 +++ b/src/server.c Sat Jan 17 09:03:05 2004 +0000 @@ -1087,6 +1087,7 @@ GaimConversation *c; GaimBuddy *b; GSList *buddies; + int old_idle; account = gaim_connection_get_account(gc); b = gaim_find_buddy(account, name); @@ -1120,11 +1121,7 @@ gaim_blist_save(); } - if (!b->idle && idle) { - gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle", b); - } else if (b->idle && !idle) { - gaim_signal_emit(gaim_blist_get_handle(), "buddy-unidle", b); - } + old_idle = b->idle; if (gc->login_time_official && gc->login_time) signon += gc->login_time_official - gc->login_time; @@ -1139,6 +1136,12 @@ */ gaim_blist_update_buddy_status(b, type); + if (!old_idle && idle) { + gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle", b); + } else if (old_idle && !idle) { + gaim_signal_emit(gaim_blist_get_handle(), "buddy-unidle", b); + } + if (loggedin) { if (!GAIM_BUDDY_IS_ONLINE(b)) { if (gaim_prefs_get_bool("/core/conversations/im/show_login")) {