diff libpurple/account.c @ 25808:5ebfa814b9e8

Finish off the libpurple updates for the hidden blist structs
author Gary Kramlich <grim@reaperworld.com>
date Sun, 02 Nov 2008 10:54:00 +0000
parents 8282911d5e17
children 41485746e2b9
line wrap: on
line diff
--- a/libpurple/account.c	Sun Nov 02 10:21:19 2008 +0000
+++ b/libpurple/account.c	Sun Nov 02 10:54:00 2008 +0000
@@ -2249,7 +2249,9 @@
 		/* Make a list of what group each buddy is in */
 		for (cur = buddies; cur != NULL; cur = cur->next) {
 			PurpleBlistNode *node = cur->data;
-			groups = g_list_append(groups, node->parent->parent);
+			PurpleBlistNode *parent = purple_blist_node_get_parent(node);
+			PurpleBlistNode *gparent = purple_blist_node_get_parent(parent);
+			groups = g_list_append(groups, gparent);
 		}
 
 		if (prpl_info->add_buddies != NULL)
@@ -2499,23 +2501,26 @@
 	purple_accounts_remove(account);
 
 	/* Remove this account's buddies */
-	for (gnode = purple_get_blist()->root; gnode != NULL; gnode = gnode->next) {
+	for (gnode = purple_blist_get_root();
+	     gnode != NULL;
+		 gnode = purple_blist_node_get_sibling_next(gnode))
+	{
 		if (!PURPLE_BLIST_NODE_IS_GROUP(gnode))
 			continue;
 
-		cnode = gnode->child;
+		cnode = purple_blist_node_get_first_child(gnode);
 		while (cnode) {
-			PurpleBlistNode *cnode_next = cnode->next;
+			PurpleBlistNode *cnode_next = purple_blist_node_get_sibling_next(cnode);
 
 			if(PURPLE_BLIST_NODE_IS_CONTACT(cnode)) {
-				bnode = cnode->child;
+				bnode = purple_blist_node_get_first_child(cnode);
 				while (bnode) {
-					PurpleBlistNode *bnode_next = bnode->next;
+					PurpleBlistNode *bnode_next = purple_blist_node_get_sibling_next(bnode);
 
 					if (PURPLE_BLIST_NODE_IS_BUDDY(bnode)) {
 						PurpleBuddy *b = (PurpleBuddy *)bnode;
 
-						if (b->account == account)
+						if (purple_buddy_get_account(b) == account)
 							purple_blist_remove_buddy(b);
 					}
 					bnode = bnode_next;
@@ -2523,7 +2528,7 @@
 			} else if (PURPLE_BLIST_NODE_IS_CHAT(cnode)) {
 				PurpleChat *c = (PurpleChat *)cnode;
 
-				if (c->account == account)
+				if (purple_chat_get_account(c) == account)
 					purple_blist_remove_chat(c);
 			}
 			cnode = cnode_next;