pidgin: 3ad9ca55: When defaulting a group, don't move it t...

datallah at pidgin.im datallah at pidgin.im
Fri May 16 17:06:21 EDT 2008


-----------------------------------------------------------------
Revision: 3ad9ca55d458cd83d7e8caa6bd25a68d3f253c2b
Ancestor: cfb4e6cc05da7ca3188e215dd54ad67643b46e3f
Author: datallah at pidgin.im
Date: 2008-05-16T21:00:26
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/3ad9ca55d458cd83d7e8caa6bd25a68d3f253c2b

Modified files:
        libpurple/blist.c

ChangeLog: 

When defaulting a group, don't move it to the bottom if it exists.

-------------- next part --------------
============================================================
--- libpurple/blist.c	f57e84e7cd1357648af932e0f57fb9d1bd919698
+++ libpurple/blist.c	bb1e3d7ba4bc858d72bbd7c77813239f5a6d8447
@@ -1233,16 +1233,13 @@ void purple_blist_add_chat(PurpleChat *c
 	g_return_if_fail(PURPLE_BLIST_NODE_IS_CHAT((PurpleBlistNode *)chat));
 
 	if (node == NULL) {
-		if (group == NULL) {
+		if (group == NULL)
 			group = purple_group_new(_("Chats"));
+
+		/* Add group to blist if isn't already on it. Fixes #2752. */
+		if (!purple_find_group(group->name)) {
 			purple_blist_add_group(group,
 					purple_blist_get_last_sibling(purplebuddylist->root));
-		} else {
-			/* Add group to blist if isn't already on it. Fixes #2752. */
-			if (!purple_find_group(group->name)) {
-				purple_blist_add_group(group,
-						purple_blist_get_last_sibling(purplebuddylist->root));
-			}
 		}
 	} else {
 		group = (PurpleGroup*)node->parent;
@@ -1336,16 +1333,11 @@ void purple_blist_add_buddy(PurpleBuddy 
 		c = contact;
 		g = (PurpleGroup *)((PurpleBlistNode *)c)->parent;
 	} else {
-		if (group) {
-			/* Add group to blist if isn't already on it. Fixes #2752. */
-			if (!purple_find_group(group->name)) {
-				purple_blist_add_group(group,
-						purple_blist_get_last_sibling(purplebuddylist->root));
-			}
-
-			g = group;
-		} else {
+		g = group;
+		if (g == NULL)
 			g = purple_group_new(_("Buddies"));
+		/* Add group to blist if isn't already on it. Fixes #2752. */
+		if (!purple_find_group(g->name)) {
 			purple_blist_add_group(g,
 					purple_blist_get_last_sibling(purplebuddylist->root));
 		}
@@ -1555,9 +1547,12 @@ void purple_blist_add_contact(PurpleCont
 	else if (group)
 		g = group;
 	else {
-		g = purple_group_new(_("Buddies"));
-		purple_blist_add_group(g,
-				purple_blist_get_last_sibling(purplebuddylist->root));
+		g = purple_find_group(_("Buddies"));
+		if (g == NULL) {
+			g = purple_group_new(_("Buddies"));
+			purple_blist_add_group(g,
+					purple_blist_get_last_sibling(purplebuddylist->root));
+		}
 	}
 
 	gnode = (PurpleBlistNode*)g;


More information about the Commits mailing list