diff libpurple/protocols/msn/contact.c @ 28668:23f6f80f45ed

Due to a server change, the friendly name on MSN was being changed to the first name of the user as supplied in their Address Book. Cache friendly names and use that at login, with a fallback to the AB name when none has been set. Fixes #10763.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 28 Nov 2009 23:13:55 +0000
parents 9aa7f4801549
children 452043d200f0
line wrap: on
line diff
--- a/libpurple/protocols/msn/contact.c	Sat Nov 28 21:33:06 2009 +0000
+++ b/libpurple/protocols/msn/contact.c	Sat Nov 28 23:13:55 2009 +0000
@@ -702,12 +702,15 @@
 		type = xmlnode_get_data(contactType);
 
 		/*setup the Display Name*/
-		if (type && !strcmp(type, "Me")){
-			char *friendly = NULL;
-			if ((displayName = xmlnode_get_child(contactInfo, "displayName")))
-				friendly = xmlnode_get_data(displayName);
-			purple_connection_set_display_name(session->account->gc, friendly ? purple_url_decode(friendly) : NULL);
-			g_free(friendly);
+		if (type && !strcmp(type, "Me")) {
+			if (purple_connection_get_display_name(pc) == NULL) {
+				char *friendly = NULL;
+				if ((displayName = xmlnode_get_child(contactInfo, "displayName")))
+					friendly = xmlnode_get_data(displayName);
+				purple_connection_set_display_name(pc,
+					friendly ? purple_url_decode(friendly) : NULL);
+				g_free(friendly);
+			}
 			continue; /* Not adding own account as buddy to buddylist */
 		}