pidgin: f6d37faf: I tested with AIM 7.2.6.1 and ICQ 7.2 bu...

markdoliner at pidgin.im markdoliner at pidgin.im
Wed Dec 1 21:40:56 EST 2010


----------------------------------------------------------------------
Revision: f6d37fafbb5ebe21254edb345e53078feb9e7cba
Parent:   3f7ce0979147c5415dbc19906d2fd83bc5b5bfd0
Author:   markdoliner at pidgin.im
Date:     12/01/10 21:35:52
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f6d37fafbb5ebe21254edb345e53078feb9e7cba

Changelog: 

I tested with AIM 7.2.6.1 and ICQ 7.2 build 3159 and both of them
send no status message to indicate that the status message has been
cleared.  So it really seems like this comment and this behavior
is incorrect.

This fixes #12988.  I haven't noticed any side effects yet.  The
side effect I'm worried about is that maybe we'll clear someone's
status message when we shouldn't (because we receive a userinfo
packet without a status message for whatever reason)

Changes against parent 3f7ce0979147c5415dbc19906d2fd83bc5b5bfd0

  patched  libpurple/protocols/oscar/oscar.c

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oscar.c	9e7fe7137a6338d84de41fa04c5e3f3d86ea2cee
+++ libpurple/protocols/oscar/oscar.c	0aa016ff1b6c1e247b9e32e5c06a101b59f748ef
@@ -1366,7 +1366,7 @@ static int purple_parse_oncoming(OscarDa
 	const char *status_id;
 	va_list ap;
 	aim_userinfo_t *info;
-	char *message = NULL;
+	char *message;
 	char *itmsurl = NULL;
 
 	gc = od->gc;
@@ -1453,16 +1453,13 @@ static int purple_parse_oncoming(OscarDa
 		purple_prpl_got_user_status_deactive(account, info->bn, OSCAR_STATUS_ID_MOBILE);
 	}
 
-	/* Empty status means we should unset the status message. NULL status means we should keep it from the previous active status.
-	 * Same goes for itmsurl (which is available only for the "available" status).
-	 */
-	if (info->status != NULL) {
-		message = (info->status_len > 0) ? oscar_encoding_to_utf8(info->status_encoding, info->status, info->status_len) : NULL;
-	} else if (previous_status != NULL) {
-		message = g_strdup(purple_status_get_attr_string(previous_status, "message"));
-	}
+	message = (info->status && info->status_len > 0)
+			? oscar_encoding_to_utf8(info->status_encoding, info->status, info->status_len)
+			: NULL;
 
 	if (strcmp(status_id, OSCAR_STATUS_ID_AVAILABLE) == 0) {
+		/* TODO: If itmsurl is NULL, does that mean the URL has been
+		   cleared?  Or does it mean the URL should remain unchanged? */
 		if (info->itmsurl != NULL) {
 			itmsurl = (info->itmsurl_len > 0) ? oscar_encoding_to_utf8(info->itmsurl_encoding, info->itmsurl, info->itmsurl_len) : NULL;
 		} else if (previous_status != NULL && purple_status_is_available(previous_status)) {


More information about the Commits mailing list