Mercurial > pidgin
diff src/server.c @ 9993:bdec08a8fc5b
[gaim-migrate @ 10906]
Remove away.c and away.h
And get rid of some code in server.c that I'm pretty sure doesn't
do anything
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Thu, 09 Sep 2004 03:36:35 +0000 |
| parents | 5b13241a32c8 |
| children | 32467b63f55a |
line wrap: on
line diff
--- a/src/server.c Thu Sep 09 03:20:48 2004 +0000 +++ b/src/server.c Thu Sep 09 03:36:35 2004 +0000 @@ -36,7 +36,6 @@ #include "util.h" /* XXX UI Stuff */ -#include "away.h" #include "gtkdialogs.h" #include "gaim.h" #include "gtkimhtml.h" @@ -45,9 +44,6 @@ #define SECS_BEFORE_RESENDING_AUTORESPONSE 600 #define SEX_BEFORE_RESENDING_AUTORESPONSE "Only after you're married" -static void add_idle_buddy(GaimBuddy *buddy); -static void remove_idle_buddy(GaimBuddy *buddy); - void serv_login(GaimAccount *account) { GaimPlugin *p = gaim_find_prpl(gaim_account_get_protocol_id(account)); @@ -396,9 +392,6 @@ { GaimPluginProtocolInfo *prpl_info = NULL; - if (gaim_presence_is_idle(gaim_buddy_get_presence(buddy))) - remove_idle_buddy(buddy); - if (gc != NULL && gc->prpl != NULL) prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl); @@ -418,12 +411,6 @@ if (prpl_info && g_list_find(gaim_connections_get_all(), gc)) { if (prpl_info->remove_buddies) { - GList *curb; - for (curb = buddies; curb != NULL; curb = curb->next) { - GaimBuddy *buddy = curb->data; - if (gaim_presence_is_idle(gaim_buddy_get_presence(buddy))) - remove_idle_buddy(buddy); - } prpl_info->remove_buddies(gc, buddies, groups); } else { GList *curb = buddies; @@ -1067,64 +1054,6 @@ } /* - * 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, *l_next; - - for (l = idle_buddies; l != NULL; l = l_next) - { - GaimBuddy *buddy = (GaimBuddy *)l->data; - - l_next = l->next; - - if (!GAIM_BUDDY_IS_ONLINE(buddy) || - gaim_presence_is_idle(gaim_buddy_get_presence(buddy))) - { - remove_idle_buddy(buddy); - } - else - { - gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle-updated", - l->data); - } - } - - return TRUE; -} - -static void -add_idle_buddy(GaimBuddy *buddy) -{ - idle_buddies = g_list_append(idle_buddies, buddy); - - if (idle_buddy_timeout_id == 0) - { - idle_buddy_timeout_id = gaim_timeout_add(10000, - (GSourceFunc)idle_timeout_cb, NULL); - } -} - -static void -remove_idle_buddy(GaimBuddy *buddy) -{ - idle_buddies = g_list_remove(idle_buddies, buddy); - - if (idle_buddies == NULL) - { - gaim_timeout_remove(idle_buddy_timeout_id); - idle_buddy_timeout_id = 0; - } -} - -/* * @param idle The time at which the buddy became idle, in seconds * since the epoch. */
