changeset 23366:98594354b423

Don't cycle through a NULL "message" when purple_parse_oncoming() is called for an away oscar buddy. purple_got_infoblock() will supply a message as appropriate.
author Evan Schoenberg <evan.s@dreskin.net>
date Sat, 14 Jun 2008 19:12:47 +0000
parents ef4dbd2bb696
children 31fa01597dce
files libpurple/protocols/oscar/oscar.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c	Sat Jun 14 04:50:35 2008 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Sat Jun 14 19:12:47 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 */