diff 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
line wrap: on
line diff
--- 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")) {