comparison src/server.c @ 8129:52cdf2740654

[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 <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 17 Jan 2004 09:03:05 +0000
parents fa6395637e2c
children 4971193f761d
comparison
equal deleted inserted replaced
8128:9aafd344230d 8129:52cdf2740654
1085 { 1085 {
1086 GaimAccount *account; 1086 GaimAccount *account;
1087 GaimConversation *c; 1087 GaimConversation *c;
1088 GaimBuddy *b; 1088 GaimBuddy *b;
1089 GSList *buddies; 1089 GSList *buddies;
1090 int old_idle;
1090 1091
1091 account = gaim_connection_get_account(gc); 1092 account = gaim_connection_get_account(gc);
1092 b = gaim_find_buddy(account, name); 1093 b = gaim_find_buddy(account, name);
1093 1094
1094 if (signon && (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->options & 1095 if (signon && (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->options &
1118 if (strcmp(name, b->name)) { 1119 if (strcmp(name, b->name)) {
1119 gaim_blist_rename_buddy(b, name); 1120 gaim_blist_rename_buddy(b, name);
1120 gaim_blist_save(); 1121 gaim_blist_save();
1121 } 1122 }
1122 1123
1123 if (!b->idle && idle) { 1124 old_idle = b->idle;
1124 gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle", b);
1125 } else if (b->idle && !idle) {
1126 gaim_signal_emit(gaim_blist_get_handle(), "buddy-unidle", b);
1127 }
1128 1125
1129 if (gc->login_time_official && gc->login_time) 1126 if (gc->login_time_official && gc->login_time)
1130 signon += gc->login_time_official - gc->login_time; 1127 signon += gc->login_time_official - gc->login_time;
1131 gaim_blist_update_buddy_signon(b, signon); 1128 gaim_blist_update_buddy_signon(b, signon);
1132 gaim_blist_update_buddy_idle(b, idle); 1129 gaim_blist_update_buddy_idle(b, idle);
1136 system_log(log_back, gc, b, OPT_LOG_BUDDY_AWAY); 1133 system_log(log_back, gc, b, OPT_LOG_BUDDY_AWAY);
1137 else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE)) 1134 else if (!(b->uc & UC_UNAVAILABLE) && (type & UC_UNAVAILABLE))
1138 system_log(log_away, gc, b, OPT_LOG_BUDDY_AWAY); 1135 system_log(log_away, gc, b, OPT_LOG_BUDDY_AWAY);
1139 */ 1136 */
1140 gaim_blist_update_buddy_status(b, type); 1137 gaim_blist_update_buddy_status(b, type);
1138
1139 if (!old_idle && idle) {
1140 gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle", b);
1141 } else if (old_idle && !idle) {
1142 gaim_signal_emit(gaim_blist_get_handle(), "buddy-unidle", b);
1143 }
1141 1144
1142 if (loggedin) { 1145 if (loggedin) {
1143 if (!GAIM_BUDDY_IS_ONLINE(b)) { 1146 if (!GAIM_BUDDY_IS_ONLINE(b)) {
1144 if (gaim_prefs_get_bool("/core/conversations/im/show_login")) { 1147 if (gaim_prefs_get_bool("/core/conversations/im/show_login")) {
1145 if (c != NULL) { 1148 if (c != NULL) {