changeset 9235:7ae39c31e401

[gaim-migrate @ 10031] Revert that for now. I didn't take into account buddys being removed. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 08 Jun 2004 02:05:05 +0000
parents f18eb3f22733
children e8d86fd68552
files src/gtkblist.c src/server.c
diffstat 2 files changed, 6 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkblist.c	Tue Jun 08 02:02:25 2004 +0000
+++ b/src/gtkblist.c	Tue Jun 08 02:05:05 2004 +0000
@@ -3541,6 +3541,8 @@
 			idle = g_strdup_printf("(%d:%02d)", ihrs, imin);
 		else
 			idle = g_strdup_printf("(%d)", imin);
+
+		gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle-updated", buddy);
 	}
 
 	if (buddy->evil > 0)
--- a/src/server.c	Tue Jun 08 02:02:25 2004 +0000
+++ b/src/server.c	Tue Jun 08 02:05:05 2004 +0000
@@ -1055,27 +1055,7 @@
 	g_free(message);
 }
 
-/*
- * NOTE: This is a bit hacky, but needed for core support for the
- *       buddy-idle-updated signal. It's temporary, and will be replaced
- *       with better code in the status rewrite.
- */
-static GList *idle_buddies = NULL;
-static guint idle_buddy_timeout_id = 0;
 
-static gboolean
-idle_timeout_cb(void)
-{
-	GList *l;
-
-	for (l = idle_buddies; l != NULL; l = l->next)
-	{
-		gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle-updated",
-						 l->data);
-	}
-
-	return TRUE;
-}
 
 void serv_got_update(GaimConnection *gc, const char *name, int loggedin,
 					 int evil, time_t signon, time_t idle, int type)
@@ -1239,26 +1219,14 @@
 	if (!old_idle && idle)
 	{
 		gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle", b);
-
-		idle_buddies = g_list_append(idle_buddies, b);
-
-		if (idle_buddy_timeout_id == 0)
-		{
-			idle_buddy_timeout_id = gaim_timeout_add(10000,
-				(GSourceFunc)idle_timeout_cb, NULL);
-		}
 	}
 	else if (old_idle && !idle)
 	{
 		gaim_signal_emit(gaim_blist_get_handle(), "buddy-unidle", b);
-
-		idle_buddies = g_list_remove(idle_buddies, b);
-
-		if (idle_buddies == NULL)
-		{
-			gaim_timeout_remove(idle_buddy_timeout_id);
-			idle_buddy_timeout_id = 0;
-		}
+	}
+	else if (old_idle != idle)
+	{
+		gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle-updated", b);
 	}
 
 	if (c != NULL)