changeset 27074:a9f5afce8f39

gadu-gadu: There's no need to set all buddies to offline at logout Other protocols (well, XMPP and OSCAR) don't do this sort of thing and the buddies are removed from the buddy list in _purple_connection_destroy.
author Paul Aurich <paul@darkrain42.org>
date Mon, 01 Jun 2009 02:28:39 +0000
parents 85a4c248f751
children 5ff1d66e6aef
files libpurple/protocols/gg/buddylist.c libpurple/protocols/gg/buddylist.h libpurple/protocols/gg/gg.c
diffstat 3 files changed, 1 insertions(+), 60 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/gg/buddylist.c	Sun May 31 20:46:42 2009 +0000
+++ b/libpurple/protocols/gg/buddylist.c	Mon Jun 01 02:28:39 2009 +0000
@@ -178,55 +178,6 @@
 }
 /* }}} */
 
-/* void ggp_buddylist_offline(PurpleConnection *gc) {{{ */
-void ggp_buddylist_offline(PurpleConnection *gc)
-{
-	PurpleAccount *account = purple_connection_get_account(gc);
-	PurpleBlistNode *gnode, *cnode, *bnode;
-	PurpleBuddy *buddy;
-
-	for (gnode = purple_blist_get_root();
-	     gnode != NULL;
-	     gnode = purple_blist_node_get_sibling_next(gnode))
-	{
-		if (!PURPLE_BLIST_NODE_IS_GROUP(gnode))
-			continue;
-
-		for (cnode = purple_blist_node_get_first_child(gnode);
-		     cnode != NULL;
-		     cnode = purple_blist_node_get_sibling_next(cnode))
-		{
-			if (!PURPLE_BLIST_NODE_IS_CONTACT(cnode))
-				continue;
-
-			for (bnode = purple_blist_node_get_first_child(cnode);
-			     bnode != NULL;
-			     bnode = purple_blist_node_get_sibling_next(bnode))
-			{
-				const gchar *name = NULL;
-
-				if (!PURPLE_BLIST_NODE_IS_BUDDY(bnode))
-					continue;
-
-				buddy = (PurpleBuddy *)bnode;
-				
-				name = purple_buddy_get_name(buddy);
-
-				if (purple_buddy_get_account(buddy) != account)
-					continue;
-
-				purple_prpl_got_user_status(
-					account, name, "offline", NULL);
-
-				purple_debug_info("gg",
-					"ggp_buddylist_offline: gone: %s\n",
-					name);
-			}
-		}
-	}
-}
-/* }}} */
-
 /* char *ggp_buddylist_dump(PurpleAccount *account) {{{ */
 char *ggp_buddylist_dump(PurpleAccount *account)
 {
--- a/libpurple/protocols/gg/buddylist.h	Sun May 31 20:46:42 2009 +0000
+++ b/libpurple/protocols/gg/buddylist.h	Mon Jun 01 02:28:39 2009 +0000
@@ -31,7 +31,7 @@
 ggp_buddylist_send(PurpleConnection *gc);
 
 /**
- * Load buddylist from server into the rooster.
+ * Load buddylist from server into the roster.
  *
  * @param gc PurpleConnection
  * @param buddylist Pointer to the buddylist that will be loaded.
@@ -41,14 +41,6 @@
 ggp_buddylist_load(PurpleConnection *gc, char *buddylist);
 
 /**
- * Set offline status for all buddies.
- *
- * @param gc Connection handler
- */
-void
-ggp_buddylist_offline(PurpleConnection *gc);
-
-/**
  * Get all the buddies in the current account.
  *
  * @param account Current account.
--- a/libpurple/protocols/gg/gg.c	Sun May 31 20:46:42 2009 +0000
+++ b/libpurple/protocols/gg/gg.c	Mon Jun 01 02:28:39 2009 +0000
@@ -1837,8 +1837,6 @@
 	if (gc->inpa > 0)
 		purple_input_remove(gc->inpa);
 
-	ggp_buddylist_offline(gc);
-
 	purple_debug_info("gg", "Connection closed.\n");
 }