# HG changeset patch # User Elliott Sales de Andrade # Date 1259450035 0 # Node ID 23f6f80f45ed1fc653ff8faf087e21f5dc26c389 # Parent 7e1b787383526f0631a68312f9c3d7234d4d20cd 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. diff -r 7e1b78738352 -r 23f6f80f45ed ChangeLog --- a/ChangeLog Sat Nov 28 21:33:06 2009 +0000 +++ b/ChangeLog Sat Nov 28 23:13:55 2009 +0000 @@ -32,6 +32,9 @@ * 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 diff -r 7e1b78738352 -r 23f6f80f45ed libpurple/protocols/msn/contact.c --- 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 */ } diff -r 7e1b78738352 -r 23f6f80f45ed libpurple/protocols/msn/msn.c --- a/libpurple/protocols/msn/msn.c Sat Nov 28 21:33:06 2009 +0000 +++ b/libpurple/protocols/msn/msn.c Sat Nov 28 23:13:55 2009 +0000 @@ -1062,6 +1062,9 @@ 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, diff -r 7e1b78738352 -r 23f6f80f45ed libpurple/protocols/msn/notification.c --- a/libpurple/protocols/msn/notification.c Sat Nov 28 21:33:06 2009 +0000 +++ b/libpurple/protocols/msn/notification.c Sat Nov 28 23:13:55 2009 +0000 @@ -1408,6 +1408,7 @@ purple_connection_set_display_name( purple_account_get_connection(session->account), friendlyname); + purple_account_set_string(session->account, "display-name", friendlyname); } } }