pidgin: 5471a430: Due to a server change, the friendly nam...

qulogic at pidgin.im qulogic at pidgin.im
Sat Nov 28 18:16:36 EST 2009


-----------------------------------------------------------------
Revision: 5471a4305312ead74567c9099c837adcbebb640c
Ancestor: 3bffd7b4a3d8f99940661652e971595b53cdc48d
Author: qulogic at pidgin.im
Date: 2009-11-28T23:13:55
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/5471a4305312ead74567c9099c837adcbebb640c

Modified files:
        ChangeLog libpurple/protocols/msn/contact.c
        libpurple/protocols/msn/msn.c
        libpurple/protocols/msn/notification.c

ChangeLog: 

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.

-------------- next part --------------
============================================================
--- ChangeLog	e322c6c374458c20a92b565c4d1ae8fc3ab52f95
+++ ChangeLog	df5e36c21ff0f2d7dfa41793abe40df89d1a6601
@@ -32,6 +32,9 @@ version 2.6.4 (??/??/20??):
 	* Fix a random crash that might occur when idle.
 	* Fix a crash when logging in with some long non-ASCII passwords.
 	  (Shaun Lindsay)
+	* Cache our own friendly name as the server no longer does that for
+	  us.  Users of older versions may need to re-set their friendly name
+	  as it has probably been reset.
 
 	XMPP:
 	* Users connecting to Google Talk now have an "Initiate Chat" context menu
============================================================
--- libpurple/protocols/msn/contact.c	4e7e5c11fec13eed105fdcbeb2947a76f302155a
+++ libpurple/protocols/msn/contact.c	0ed1e3d3b728dc3e5d9e38657b0d1fc654ac75cb
@@ -702,12 +702,15 @@ msn_parse_addressbook_contacts(MsnSessio
 		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 */
 		}
 
============================================================
--- libpurple/protocols/msn/msn.c	47bdf05c0a234a66feb0f5bb4af53fccdb08f061
+++ libpurple/protocols/msn/msn.c	b3668411315e4aa60e83e55ef560cc392f789fdc
@@ -1062,6 +1062,9 @@ msn_login(PurpleAccount *account)
 	if (strcmp(username, purple_account_get_username(account)))
 		purple_account_set_username(account, username);
 
+	username = purple_account_get_string(account, "display-name", NULL);
+	purple_connection_set_display_name(gc, username);
+
 	if (!msn_session_connect(session, host, port, http_method))
 		purple_connection_error_reason(gc,
 			PURPLE_CONNECTION_ERROR_NETWORK_ERROR,
============================================================
--- libpurple/protocols/msn/notification.c	d9034b62aceaf8d5f7dfae0ca15aa8a09d886627
+++ libpurple/protocols/msn/notification.c	8cb5c39b4bf3d6b3aefeb12546c0d9905b369f6c
@@ -1408,6 +1408,7 @@ prp_cmd(MsnCmdProc *cmdproc, MsnCommand 
 				purple_connection_set_display_name(
 					purple_account_get_connection(session->account),
 					friendlyname);
+				purple_account_set_string(session->account, "display-name", friendlyname);
 			}
 		}
 	}


More information about the Commits mailing list