adium-1.4 3515:7ab7cfe526ed: This is actually how gtkblist.c doe...

commits at adium.im commits at adium.im
Wed Jun 15 22:37:35 UTC 2011


details:	http://hg.adium.im/adium-1.4/rev/7ab7cfe526ed
revision:	3515:7ab7cfe526ed
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Thu Jun 16 00:32:59 2011 +0200

This is actually how gtkblist.c does it. Do not attempt to add a buddy with purple_blist_add_buddy() when the buddy already existed.

Refs #15260
(transplanted from aaff902ce46d786c03deeefc9bb0f82299e8c1e5)

diffs (26 lines):

diff -r 543e3dd827b1 -r 7ab7cfe526ed Plugins/Purple Service/SLPurpleCocoaAdapter.m
--- a/Plugins/Purple Service/SLPurpleCocoaAdapter.m	Mon Jun 13 14:07:48 2011 +0200
+++ b/Plugins/Purple Service/SLPurpleCocoaAdapter.m	Thu Jun 16 00:32:59 2011 +0200
@@ -1003,14 +1003,17 @@
 	
 	// Find an existing buddy in the group.
 	buddy = purple_find_buddy_in_group(account, buddyUTF8String, group);
-	if (!buddy) buddy = purple_buddy_new(account, buddyUTF8String, aliasUTF8String);
+	if (!buddy) {
+		buddy = purple_buddy_new(account, buddyUTF8String, aliasUTF8String);
+		
+		/* purple_blist_add_buddy() will move an existing contact serverside, but will not add a buddy serverside.
+		 * We're working with a new contact, hopefully, so we want to call serv_add_buddy() after modifying the purple list.
+		 * This is the order done in add_buddy_cb() in gtkblist.c */
+		purple_blist_add_buddy(buddy, NULL, group, NULL);
+	}
 
 	AILog(@"Adding buddy %s to group %s with alias %s",purple_buddy_get_name(buddy), group->name, aliasUTF8String);
 
-	/* purple_blist_add_buddy() will move an existing contact serverside, but will not add a buddy serverside.
-	 * We're working with a new contact, hopefully, so we want to call serv_add_buddy() after modifying the purple list.
-	 * This is the order done in add_buddy_cb() in gtkblist.c */
-	purple_blist_add_buddy(buddy, NULL, group, NULL);
 	purple_account_add_buddy(account, buddy);
 }
 




More information about the commits mailing list