gobjectification: b1644c83: Get Finch to compile. Someone should pro...

qulogic at pidgin.im qulogic at pidgin.im
Wed Jun 9 01:30:49 EDT 2010


-----------------------------------------------------------------
Revision: b1644c83a3106c43f068d68e392c2ff06e8f9e25
Ancestor: dfb672c84d488ae378020799aa628bca0da795bd
Author: qulogic at pidgin.im
Date: 2010-06-09T04:53:50
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/b1644c83a3106c43f068d68e392c2ff06e8f9e25

Modified files:
        finch/gntblist.c finch/gntconv.c

ChangeLog: 

Get Finch to compile. Someone should probably check I got that adding bit
right in gntblist.c.

-------------- next part --------------
============================================================
--- finch/gntblist.c	df3849ffabbd2020c477e17cf935043c04b0abe1
+++ finch/gntblist.c	63c36e882befd129cf75ef97534c3204fba7636c
@@ -584,7 +584,7 @@ new_list(void)
 		ggblist->manager = &default_manager;
 }
 
-static void destroy_list(PurpleBuddyList *list)
+static void destroy_list(void)
 {
 	if (ggblist == NULL)
 		return;
@@ -641,7 +641,7 @@ add_buddy_cb(void *data, PurpleRequestFi
 	if (!grp)
 	{
 		grp = purple_group_new(group);
-		purple_blist_add_group(grp, NULL);
+		purple_blist_node_add_child(PURPLE_BLIST_NODE(grp), purple_blist_get_root());
 	}
 
 	/* XXX: Ask to merge if there's already a buddy with the same alias in the same group (#4553) */
@@ -694,17 +694,18 @@ join_chat(PurpleChat *chat)
 	PurpleAccount *account = purple_chat_get_account(chat);
 	const char *name;
 	PurpleConversation *conv;
-	const char *alias;
+	char *alias;
 
 	/* This hack here is to work around the fact that there's no good way of
 	 * getting the actual name of a chat. I don't understand why we return
 	 * the alias for a chat when all we want is the name. */
-	alias = chat->alias;
-	chat->alias = NULL;
+	alias = g_strdup(purple_chat_get_alias(chat));
+	purple_chat_set_alias(chat, NULL);
 	name = purple_chat_get_name(chat);
 	conv = purple_find_conversation_with_account(
 			PURPLE_CONV_TYPE_CHAT, name, account);
-	chat->alias = (char *)alias;
+	purple_chat_set_alias(chat, alias);
+	g_free(alias);
 
 	if (!conv || purple_conv_chat_has_left(PURPLE_CONV_CHAT(conv))) {
 		serv_join_chat(purple_account_get_connection(account),
@@ -748,7 +749,7 @@ add_chat_cb(void *data, PurpleRequestFie
 	if (chat != NULL) {
 		if ((grp = purple_find_group(group)) == NULL) {
 			grp = purple_group_new(group);
-			purple_blist_add_group(grp, NULL);
+			purple_blist_node_add_child(PURPLE_BLIST_NODE(grp), purple_blist_get_root());
 		}
 		purple_blist_add_chat(chat, grp, NULL);
 		purple_chat_set_alias(chat, alias);
@@ -808,7 +809,7 @@ add_group_cb(gpointer null, const char *
 	grp = purple_find_group(group);
 	if (!grp) {
 		grp = purple_group_new(group);
-		purple_blist_add_group(grp, NULL);
+		purple_blist_node_add_child(PURPLE_BLIST_NODE(grp), purple_blist_get_root());
 	}
 
 	if (!ggblist)
@@ -1382,7 +1383,7 @@ remove_contact(PurpleContact *contact)
 		if (purple_account_is_connected(account))
 			purple_account_remove_buddy(account, buddy, group);
 	}
-	purple_blist_remove_contact(contact);
+	purple_blist_node_remove(PURPLE_BLIST_NODE(contact));
 }
 
 static void
@@ -1497,7 +1498,7 @@ remove_group(PurpleGroup *group)
 					account = purple_buddy_get_account(buddy);
 					if (purple_account_is_connected(account)) {
 						purple_account_remove_buddy(account, buddy, group);
-						purple_blist_remove_buddy(buddy);
+						purple_blist_node_remove(PURPLE_BLIST_NODE(buddy));
 					}
 				} else {
 					bnode = purple_blist_node_next(bnode);
@@ -1507,13 +1508,13 @@ remove_group(PurpleGroup *group)
 			PurpleChat *chat = (PurpleChat *)cnode;
 			cnode = purple_blist_node_next(cnode);
 			if (purple_account_is_connected(purple_chat_get_account(chat)))
-				purple_blist_remove_chat(chat);
+				purple_blist_node_remove(PURPLE_BLIST_NODE(chat));
 		} else {
 			cnode = purple_blist_node_next(cnode);
 		}
 	}
 
-	purple_blist_remove_group(group);
+	purple_blist_node_remove(PURPLE_BLIST_NODE(group));
 }
 
 static void
@@ -1525,9 +1526,9 @@ finch_blist_remove_node(PurpleBlistNode 
 		PurpleBuddy *buddy = (PurpleBuddy*)node;
 		PurpleGroup *group = purple_buddy_get_group(buddy);
 		purple_account_remove_buddy(purple_buddy_get_account(buddy), buddy, group);
-		purple_blist_remove_buddy(buddy);
+		purple_blist_node_remove(PURPLE_BLIST_NODE(buddy));
 	} else if (PURPLE_IS_CHAT(node)) {
-		purple_blist_remove_chat((PurpleChat*)node);
+		purple_blist_node_remove(PURPLE_BLIST_NODE(node));
 	} else if (PURPLE_IS_GROUP(node)) {
 		remove_group((PurpleGroup*)node);
 	}
@@ -1620,18 +1621,18 @@ finch_blist_place_tagged(PurpleBlistNode
 			if (PURPLE_IS_GROUP(node)) {
 				update_node_display(node, ggblist);
 				/* Add the group after the current group */
-				purple_blist_add_group((PurpleGroup*)node, (PurpleBlistNode*)tg);
+				purple_blist_node_add_child(node, PURPLE_BLIST_NODE(tg));
 			} else if (PURPLE_IS_CONTACT(node)) {
 				update_buddy_display(purple_contact_get_priority_buddy((PurpleContact*)node), ggblist);
 				if (PURPLE_BLIST_NODE(tg) == target) {
 					/* The target is a group, just add the contact to the group. */
-					purple_blist_add_contact((PurpleContact*)node, tg, NULL);
+					purple_blist_node_add_child(node, PURPLE_BLIST_NODE(tg));
 				} else if (tc) {
 					/* The target is either a buddy, or a contact. Merge with that contact. */
 					purple_blist_merge_contact((PurpleContact*)node, (PurpleBlistNode*)tc);
 				} else {
 					/* The target is a chat. Add the contact to the group after this chat. */
-					purple_blist_add_contact((PurpleContact*)node, NULL, target);
+					purple_blist_node_add_child(node, target);
 				}
 			} else if (PURPLE_IS_BUDDY(node)) {
 				update_buddy_display((PurpleBuddy*)node, ggblist);
============================================================
--- finch/gntconv.c	f5a5d688d893e77dfd0bb99c237fe00b5bd53904
+++ finch/gntconv.c	e3f43505221763d51b2d44c9b99d01fd26fbb01d
@@ -675,7 +675,7 @@ create_conv_from_userlist(GntWidget *wid
 
 	name = gnt_tree_get_selection_data(GNT_TREE(widget));
 
-	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc));
 	if (prpl_info && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_cb_real_name))
 		realname = prpl_info->get_cb_real_name(gc, purple_conv_chat_get_id(PURPLE_CONV_CHAT(fc->active_conv)), name);
 	else
@@ -1467,7 +1467,7 @@ void finch_conversation_init()
 					PURPLE_CALLBACK(account_signed_on_off), NULL);
 	purple_signal_connect(NULL, "signed-off", finch_conv_get_handle(),
 					PURPLE_CALLBACK(account_signed_on_off), NULL);
-	purple_signal_connect(purple_connections_get_handle(), "signing-off", finch_conv_get_handle(),
+	purple_signal_connect(NULL, "signing-off", finch_conv_get_handle(),
 					PURPLE_CALLBACK(account_signing_off), NULL);
 }
 


More information about the Commits mailing list