# HG changeset patch # User Christian Hammond # Date 1086661214 0 # Node ID fac583b4ecdf087bc4a55a06f7baf9fbf7841f51 # Parent e8d86fd6855297bd7ba2fae23639c9bcfa0eeb22 [gaim-migrate @ 10035] Make sure that the buddy we're emitting buddy-idle-changed for is indeed online and idle. committer: Tailor Script diff -r e8d86fd68552 -r fac583b4ecdf src/server.c --- a/src/server.c Tue Jun 08 02:12:40 2004 +0000 +++ b/src/server.c Tue Jun 08 02:20:14 2004 +0000 @@ -1075,12 +1075,23 @@ static gboolean idle_timeout_cb(void) { - GList *l; + GList *l, *l_next; + + for (l = idle_buddies; l != NULL; l = l_next) + { + GaimBuddy *buddy = (GaimBuddy *)l->data; + + l_next = l->next; - for (l = idle_buddies; l != NULL; l = l->next) - { - gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle-updated", - l->data); + if (!GAIM_BUDDY_IS_ONLINE(buddy) || buddy->idle <= 0) + { + remove_idle_buddy(buddy); + } + else + { + gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle-updated", + l->data); + } } return TRUE;