im.pidgin.pidgin: 2a9420daed1d25d2d80d951ddc9e2b6ec9f1989d

markdoliner at pidgin.im markdoliner at pidgin.im
Wed Jan 16 02:55:37 EST 2008


-----------------------------------------------------------------
Revision: 2a9420daed1d25d2d80d951ddc9e2b6ec9f1989d
Ancestor: 8420986ed527faced7f667e028eaa30a30daab93
Author: markdoliner at pidgin.im
Date: 2008-01-16T07:51:44
Branch: im.pidgin.pidgin

Modified files:
        libpurple/protocols/oscar/oscar.c

ChangeLog: 

Only try to set the itmsurl attribute for the available status.  I'd
forgotten about that when I changed this a few days ago.  As far
as I know it's only supported when you're "available."  If it works
for other statuses then please let me know and I'll make the appropriate
changes.

-------------- next part --------------
============================================================
--- libpurple/protocols/oscar/oscar.c	1a914a6635dff780cc5081da99fa99d65aaa1a67
+++ libpurple/protocols/oscar/oscar.c	95cb580e515650ce7f56ab01b708d11bb279b2f4
@@ -1735,7 +1735,6 @@ static int purple_parse_oncoming(OscarDa
 	int type = 0;
 	gboolean buddy_is_away = FALSE;
 	const char *status_id;
-	char *itmsurl = NULL;
 	va_list ap;
 	aim_userinfo_t *info;
 
@@ -1783,11 +1782,6 @@ static int purple_parse_oncoming(OscarDa
 			status_id = OSCAR_STATUS_ID_AVAILABLE;
 	}
 
-	if (info->itmsurl_encoding && info->itmsurl && info->itmsurl_len)
-		/* Grab the iTunes Music Store URL */
-		itmsurl = oscar_encoding_to_utf8(account, info->itmsurl_encoding,
-				info->itmsurl, info->itmsurl_len);
-
 	if (info->flags & AIM_FLAG_WIRELESS)
 	{
 		purple_prpl_got_user_status(account, info->sn, OSCAR_STATUS_ID_MOBILE, NULL);
@@ -1798,25 +1792,29 @@ static int purple_parse_oncoming(OscarDa
 	if (status_id == OSCAR_STATUS_ID_AVAILABLE)
 	{
 		char *message = NULL;
+		char *itmsurl = NULL;
 
 		if (info->status != NULL && info->status[0] != '\0')
 			/* Grab the available message */
 			message = oscar_encoding_to_utf8(account, info->status_encoding,
 					info->status, info->status_len);
 
+		if (info->itmsurl_encoding && info->itmsurl && info->itmsurl_len)
+			/* Grab the iTunes Music Store URL */
+			itmsurl = oscar_encoding_to_utf8(account, info->itmsurl_encoding,
+					info->itmsurl, info->itmsurl_len);
+
 		purple_prpl_got_user_status(account, info->sn, status_id,
 				"message", message, "itmsurl", itmsurl, NULL);
 
 		g_free(message);
+		g_free(itmsurl);
 	}
 	else
 	{
-		purple_prpl_got_user_status(account, info->sn, status_id,
-				"itmsurl", itmsurl, NULL);
+		purple_prpl_got_user_status(account, info->sn, status_id, NULL);
 	}
 
-	g_free(itmsurl);
-
 	/* Login time stuff */
 	if (info->present & AIM_USERINFO_PRESENT_ONLINESINCE)
 		signon = info->onlinesince;


More information about the Commits mailing list