diff finch/gntblist.c @ 24509:125cac3e24ee

The Add Buddy dialog should not blindly create a duplicate buddy in a group Fix up a subset of the prpls add_buddy functions to properly handle this situation. * Everything that comes before oscar alphabetically should work properly (except Gadu-Gadu and MSN, which need testing/another set of eyes)
author Paul Aurich <paul@darkrain42.org>
date Sat, 29 Nov 2008 18:46:49 +0000
parents 0f7a248848ed
children 9ea3474065dc
line wrap: on
line diff
--- a/finch/gntblist.c	Sat Nov 29 18:20:58 2008 +0000
+++ b/finch/gntblist.c	Sat Nov 29 18:46:49 2008 +0000
@@ -643,10 +643,14 @@
 		purple_blist_add_group(grp, NULL);
 	}
 
-	/* XXX: Ask if there's already the same buddy in the same group (#4553) */
-
-	buddy = purple_buddy_new(account, username, alias);
-	purple_blist_add_buddy(buddy, NULL, grp, NULL);
+	/* XXX: Ask to merge if there's already a buddy with the same alias in the same group (#4553) */
+
+	if ((buddy = purple_find_buddy_in_group(account, username, grp)) == NULL)
+	{
+		buddy = purple_buddy_new(account, username, alias);
+		purple_blist_add_buddy(buddy, NULL, grp, NULL);
+	}
+
 	purple_account_add_buddy(account, buddy);
 }