# HG changeset patch # User Mark Doliner # Date 1200469904 0 # Node ID dd51079b3d8c96d419d46c50e9ba210ba19029e7 # Parent c7da54111ea02e2b717a7dfade74578097b2ba3f 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. diff -r c7da54111ea0 -r dd51079b3d8c libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Wed Jan 16 07:40:12 2008 +0000 +++ b/libpurple/protocols/oscar/oscar.c Wed Jan 16 07:51:44 2008 +0000 @@ -1735,7 +1735,6 @@ 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 @@ 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,24 +1792,28 @@ 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); - } - - g_free(itmsurl); + purple_prpl_got_user_status(account, info->sn, status_id, NULL); + } /* Login time stuff */ if (info->present & AIM_USERINFO_PRESENT_ONLINESINCE)