changeset 31469:78dccab9824c

Add the session user to the userlist. This reduces the amount of special-casing needed and corrects the buddy icon if you have yourself on your list. Fixes #12973.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 10 Dec 2010 06:38:17 +0000
parents 007ae2d62ea4
children fd43277108be
files ChangeLog libpurple/protocols/msn/notification.c libpurple/protocols/msn/session.c
diffstat 3 files changed, 4 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Dec 10 05:59:21 2010 +0000
+++ b/ChangeLog	Fri Dec 10 06:38:17 2010 +0000
@@ -37,6 +37,7 @@
 	* Correctly update your own display name in the buddy list. (#13064) 
 	* Correctly show ourselves as offline in the buddy list when going
 	  invisible. (#12945)
+	* Correctly update your own icon in the buddy list. (#12973)
 
 	XMPP:
 	* Terminate Jingle sessions with unsupported content types. (#13048)
--- a/libpurple/protocols/msn/notification.c	Fri Dec 10 05:59:21 2010 +0000
+++ b/libpurple/protocols/msn/notification.c	Fri Dec 10 06:38:17 2010 +0000
@@ -1250,10 +1250,7 @@
 	networkid = atoi(cmd->params[2]);
 	friendly = purple_url_decode(cmd->params[3]);
 
-	if (g_str_equal(passport, session->user->passport))
-		user = session->user;
-	else
-		user = msn_userlist_find_user(session->userlist, passport);
+	user = msn_userlist_find_user(session->userlist, passport);
 	if (user == NULL) return;
 
 	if (msn_user_set_friendly_name(user, friendly) && user != session->user)
@@ -1705,10 +1702,7 @@
 	session = cmdproc->session;
 
 	passport = cmd->params[0];
-	if (g_str_equal(passport, session->user->passport))
-		user = session->user;
-	else
-		user = msn_userlist_find_user(session->userlist, passport);
+	user = msn_userlist_find_user(session->userlist, passport);
 	if (user == NULL) {
 		char *str = g_strndup(payload, len);
 		purple_debug_info("msn", "unknown user %s, payload is %s\n",
--- a/libpurple/protocols/msn/session.c	Fri Dec 10 05:59:21 2010 +0000
+++ b/libpurple/protocols/msn/session.c	Fri Dec 10 06:38:17 2010 +0000
@@ -46,6 +46,7 @@
 
 	session->user = msn_user_new(session->userlist,
 								 purple_account_get_username(account), NULL);
+	msn_userlist_add_user(session->userlist, msn_user_ref(session->user));
 	session->oim = msn_oim_new(session);
 
 	session->protocol_ver = 0;