cpw.darkrain42.buddy-add: e4fae922: Fix situation in which group was not spe...

paul at darkrain42.org paul at darkrain42.org
Sat Jan 17 17:57:25 EST 2009


-----------------------------------------------------------------
Revision: e4fae922272cfd510a1f55595c374c2b9f665767
Ancestor: 892b508e59b21b980090af93689ae9412ee65b58
Author: paul at darkrain42.org
Date: 2008-12-22T19:40:05
Branch: im.pidgin.cpw.darkrain42.buddy-add
URL: http://d.pidgin.im/viewmtn/revision/info/e4fae922272cfd510a1f55595c374c2b9f665767

Modified files:
        pidgin/gtkblist.c

ChangeLog: 

Fix situation in which group was not specified and
purple_find_buddy_in_group(account, who, NULL or "") won't find the existing
PurpleBuddy in "Buddies"

-------------- next part --------------
============================================================
--- pidgin/gtkblist.c	c3bd2b5b0a46ecd90ae63980f56e2bff931fe8aa
+++ pidgin/gtkblist.c	1ea5329878f7010ab8ec6b4a38fef059707587a9
@@ -6504,13 +6504,22 @@ add_buddy_cb(GtkWidget *w, int resp, Pid
 			whoalias = NULL;
 
 		g = NULL;
-		if ((grp != NULL) && (*grp != '\0') && ((g = purple_find_group(grp)) == NULL))
+		if ((grp != NULL) && (*grp != '\0'))
 		{
-			g = purple_group_new(grp);
-			purple_blist_add_group(g, NULL);
+			if ((g = purple_find_group(grp)) == NULL)
+			{
+				g = purple_group_new(grp);
+				purple_blist_add_group(g, NULL);
+			}
+
+			b = purple_find_buddy_in_group(data->account, who, g);
 		}
+		else if ((b = purple_find_buddy(data->account, who)) != NULL)
+		{
+				g = purple_buddy_get_group(b);
+		}
 
-		if ((b = purple_find_buddy_in_group(data->account, who, g)) == NULL)
+		if (b == NULL)
 		{
 			b = purple_buddy_new(data->account, who, whoalias);
 			purple_blist_add_buddy(b, NULL, g, NULL);


More information about the Commits mailing list