im.pidgin.pidgin: 4e3739b824113e22a4eca8c142e614065a39c21f

sadrul at pidgin.im sadrul at pidgin.im
Thu Dec 6 04:57:30 EST 2007


-----------------------------------------------------------------
Revision: 4e3739b824113e22a4eca8c142e614065a39c21f
Ancestor: 897b40baad99c3a9cfda58938b2bc5894e546b5a
Author: sadrul at pidgin.im
Date: 2007-12-06T09:52:58
Branch: im.pidgin.pidgin

Modified files:
        libpurple/account.c

ChangeLog: 

Normalize the names appropriately when searching for accounts. This should
allow finding accounts with the same username but different resources in jabber.
References #2049.

-------------- next part --------------
============================================================
--- libpurple/account.c	4913e4cbb4bcb3af7af553ca85a2e3fbf8c39d31
+++ libpurple/account.c	1c5a1b5589a03433466d9c5cd31c7ba29ee9743e
@@ -2529,22 +2529,19 @@ purple_accounts_find(const char *name, c
 
 	g_return_val_if_fail(name != NULL, NULL);
 
-	who = g_strdup(purple_normalize(NULL, name));
-
 	for (l = purple_accounts_get_all(); l != NULL; l = l->next) {
 		account = (PurpleAccount *)l->data;
 
-		if (!strcmp(purple_normalize(NULL, purple_account_get_username(account)), who) &&
+		who = g_strdup(purple_normalize(account, name));
+		if (!strcmp(purple_normalize(account, purple_account_get_username(account)), who) &&
 			(!protocol_id || !strcmp(account->protocol_id, protocol_id))) {
-
+			g_free(who);
 			break;
 		}
-
+		g_free(who);
 		account = NULL;
 	}
 
-	g_free(who);
-
 	return account;
 }
 


More information about the Commits mailing list