changeset 23480:ace1cd072e2f

propagate from branch 'im.pidgin.pidgin' (head c692f6fe1b8c7e0dd4b0099bd67703d5941ddac5) to branch 'im.pidgin.cpw.qulogic.msn' (head d7e83c50d97d35178be4000d030af5eda816301a)
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 15 Jun 2008 08:22:20 +0000
parents 31fa01597dce (diff) ad565744246e (current diff)
children 4cb1efafa410
files
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c	Sun Jun 15 08:19:46 2008 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Sun Jun 15 08:22:20 2008 +0000
@@ -1977,7 +1977,17 @@
 	}
 	else
 	{
-		purple_prpl_got_user_status(account, info->sn, status_id, NULL);
+		PurpleBuddy *b = purple_find_buddy(account, info->sn);
+		PurplePresence *presence = purple_buddy_get_presence(b);
+		PurpleStatus *old_status = purple_presence_get_active_status(presence);
+		PurpleStatus *new_status = purple_presence_get_status(presence, status_id);
+		
+		/* If our status_id would change with this update, pass it to the core.
+		 * However, if our status_id would not change, do nothing, as we would clear out any existing
+		 * attributes on the status prematurely. purple_got_infoblock() will update the message as needed.
+		 */
+		if (old_status != new_status)
+			purple_prpl_got_user_status(account, info->sn, status_id, NULL);
 	}
 
 	/* Login time stuff */