changeset 21656:de8e79e84636

Don't update our local display name when we get a response from the server when we store buddies' friendly names on the server. Fixes #4062. For other people who encounter this issue with Pidgin 2.3.0 I suggest you set an Alias for your account, your own friendly name is *not* being set to random things - this is a purely local display issue.
author Stu Tomlinson <stu@nosnilmot.com>
date Mon, 26 Nov 2007 22:22:04 +0000
parents 10a2ac84349d
children 49e6746fb5a7
files libpurple/protocols/msnp9/notification.c
diffstat 1 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msnp9/notification.c	Mon Nov 26 19:39:21 2007 +0000
+++ b/libpurple/protocols/msnp9/notification.c	Mon Nov 26 22:22:04 2007 +0000
@@ -780,14 +780,27 @@
 static void
 rea_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
 {
-	/* TODO: This might be for us too */
-
 	MsnSession *session;
+	PurpleAccount *account;
 	PurpleConnection *gc;
 	const char *friendly;
+	char *username;
 
 	session = cmdproc->session;
-	gc = session->account->gc;
+	account = session->account;
+	username = g_strdup(purple_normalize(account,
+						purple_account_get_username(account)));
+
+	/* Only set display name if our *own* friendly name changed! */
+	if (strcmp(username, purple_normalize(account, cmd->params[2])))
+	{
+		g_free(username);
+		return;
+	}
+
+	g_free(username);
+
+	gc = account->gc;
 	friendly = purple_url_decode(cmd->params[3]);
 
 	purple_connection_set_display_name(gc, friendly);