pidgin.next.minor: a78222ae: updated irc to use the api rather than s...

grim at pidgin.im grim at pidgin.im
Thu Oct 30 23:45:38 EDT 2008


-----------------------------------------------------------------
Revision: a78222aeb3545e27406a1b4573c8dd9011d03db4
Ancestor: 7cee5c064d15a9555be5e272a513dbbc1a637a14
Author: grim at pidgin.im
Date: 2008-10-31T03:42:38
Branch: im.pidgin.pidgin.next.minor
URL: http://d.pidgin.im/viewmtn/revision/info/a78222aeb3545e27406a1b4573c8dd9011d03db4

Modified files:
        libpurple/protocols/irc/irc.c libpurple/protocols/irc/msgs.c

ChangeLog: 

updated irc to use the api rather than structs directly


-------------- next part --------------
============================================================
--- libpurple/protocols/irc/irc.c	72232dd16f455e0ce3b0e0e11f7ae31041a40a48
+++ libpurple/protocols/irc/irc.c	e041172bccd44d5efe74b7f452bd5a5a008ec3b3
@@ -569,7 +569,7 @@ static void irc_add_buddy(PurpleConnecti
 {
 	struct irc_conn *irc = (struct irc_conn *)gc->proto_data;
 	struct irc_buddy *ib = g_new0(struct irc_buddy, 1);
-	ib->name = g_strdup(buddy->name);
+	ib->name = g_strdup(purple_buddy_get_name(buddy));
 	g_hash_table_insert(irc->buddies, ib->name, ib);
 
 	/* if the timer isn't set, this is during signon, so we don't want to flood
@@ -582,7 +582,7 @@ static void irc_remove_buddy(PurpleConne
 static void irc_remove_buddy(PurpleConnection *gc, PurpleBuddy *buddy, PurpleGroup *group)
 {
 	struct irc_conn *irc = (struct irc_conn *)gc->proto_data;
-	g_hash_table_remove(irc->buddies, buddy->name);
+	g_hash_table_remove(irc->buddies, purple_buddy_get_name(buddy));
 }
 
 static void read_input(struct irc_conn *irc, int len)
============================================================
--- libpurple/protocols/irc/msgs.c	adbd1fbbc44ab78e4df758229ccf46f507ecab9e
+++ libpurple/protocols/irc/msgs.c	54d33a55dc1e81f898a2f69d057ae1457a42ffbd
@@ -95,20 +95,29 @@ static void irc_connected(struct irc_con
 	}
 
 	/* this used to be in the core, but it's not now */
-	for (gnode = purple_get_blist()->root; gnode; gnode = gnode->next) {
+	for (gnode = purple_blist_get_root();
+	     gnode;
+	     gnode = purple_blist_node_get_sibling_next(gnode))
+	{
 		if(!PURPLE_BLIST_NODE_IS_GROUP(gnode))
 			continue;
-		for(cnode = gnode->child; cnode; cnode = cnode->next) {
+		for(cnode = purple_blist_node_get_first_child(gnode);
+		    cnode;
+		    cnode = purple_blist_node_get_sibling_next(cnode))
+		{
 			if(!PURPLE_BLIST_NODE_IS_CONTACT(cnode))
 				continue;
-			for(bnode = cnode->child; bnode; bnode = bnode->next) {
+			for(bnode = purple_blist_node_get_first_child(cnode);
+			    bnode;
+			    bnode = purple_blist_node_get_sibling_next(bnode))
+			{
 				PurpleBuddy *b;
 				if(!PURPLE_BLIST_NODE_IS_BUDDY(bnode))
 					continue;
 				b = (PurpleBuddy *)bnode;
-				if(b->account == gc->account) {
+				if(purple_buddy_get_account(b) == gc->account) {
 					struct irc_buddy *ib = g_new0(struct irc_buddy, 1);
-					ib->name = g_strdup(b->name);
+					ib->name = g_strdup(purple_buddy_get_name(b));
 					g_hash_table_insert(irc->buddies, ib->name, ib);
 				}
 			}


More information about the Commits mailing list