changeset 30883:b7b2b1f81aa0

Normalize both passports before comparation. This fixes the bug that opens a MUC with a buddy that is logged in on mutiple endpoints.
author masca@cpw.pidgin.im
date Wed, 22 Sep 2010 21:09:50 +0000
parents c0337902d62a
children c20f67f37d2b
files libpurple/protocols/msn/user.c
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/user.c	Wed Sep 22 20:58:43 2010 +0000
+++ b/libpurple/protocols/msn/user.c	Wed Sep 22 21:09:50 2010 +0000
@@ -735,11 +735,17 @@
 int
 msn_user_passport_cmp(MsnUser *user, const char *passport)
 {
-	const char *pass;
+	const char *str;
+	char *pass;
+	int result;
 
-	pass = purple_normalize_nocase(NULL, msn_user_get_passport(user));
+	str = purple_normalize_nocase(NULL, msn_user_get_passport(user));
+	pass = g_strdup(str);
 
-	return strcmp(pass, purple_normalize_nocase(NULL, passport));
+	result = g_strcmp0(pass, purple_normalize_nocase(NULL, passport));
+	g_free(pass);
+
+	return result;
 }
 
 gboolean