gobjectification: e9fb8be0: Fixed group adding/removing of nodes

aluink at soc.pidgin.im aluink at soc.pidgin.im
Wed Jul 22 22:20:52 EDT 2009


-----------------------------------------------------------------
Revision: e9fb8be0cfa989fb3fc97c38e72cee68f4a6c66b
Ancestor: 2c344c08bc11bd04bd881613645fa3d207906769
Author: aluink at soc.pidgin.im
Date: 2009-07-23T02:13:29
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/e9fb8be0cfa989fb3fc97c38e72cee68f4a6c66b

Modified files:
        libpurple/group.c

ChangeLog: 

Fixed group adding/removing of nodes

-------------- next part --------------
============================================================
--- libpurple/group.c	eeab1c08a44cc7f9102a45efd7581518bce7b992
+++ libpurple/group.c	10095187033fbb9a71dbe761f708173e736afec7
@@ -93,18 +93,11 @@ static void
 }
 
 static void
-purple_group_add_child(PurpleBlistNode *parent, PurpleBlistNode *child)
+purple_group_add_update(PurpleGroup *group, PurpleBlistNode *child)
 {
-	PurpleGroup *group;
 	PurpleChat *chat;
 	PurpleContact *contact;
 
-	g_return_if_fail(parent);
-	g_return_if_fail(child);
-	group = PURPLE_GROUP(parent);
-
-	parent_class->add_child(parent, child);
-
 	if(PURPLE_IS_CHAT(child)){
 		chat = PURPLE_CHAT(child);
 		if (purple_account_is_connected(chat->account)) {
@@ -129,6 +122,26 @@ static void
 }
 
 static void
+purple_group_add_sibling(PurpleBlistNode *node, PurpleBlistNode *location)
+{
+	g_return_if_fail(node);
+	g_return_if_fail(PURPLE_IS_GROUP(purple_blist_node_parent(location)));
+
+	parent_class->add_sibling(node, location);
+	purple_group_add_update(PURPLE_GROUP(purple_blist_node_parent(location)), node);
+}
+
+static void
+purple_group_add_child(PurpleBlistNode *parent, PurpleBlistNode *child)
+{
+	g_return_if_fail(parent);
+	g_return_if_fail(child);
+
+	parent_class->add_child(parent, child);
+	purple_group_add_update(PURPLE_GROUP(parent), child);
+}
+
+static void
 purple_group_remove_node(PurpleBlistNode *child)
 {
 	PurpleGroup *group;
@@ -325,7 +338,7 @@ purple_group_class_init(PurpleGroupClass
 	GObjectClass *obj_class = G_OBJECT_CLASS(klass);
 
 	parent_class = PURPLE_BLIST_NODE_CLASS(klass);	
-	/* parent_class->add_sibling = purple_group_add_sibling; */
+	parent_class->add_sibling = purple_group_add_sibling;
 	parent_class->add_child = purple_group_add_child;
 	parent_class->remove = purple_group_remove_node;
 


More information about the Commits mailing list