# HG changeset patch # User Elliott Sales de Andrade # Date 1227506701 0 # Node ID 7a5f6ddd11b1e66b6fab5c4b3b3026aafbd9a6ed # Parent e344426d7c28eb65c4abde448b8615f85c900422 Only get the artist and album if we are setting a Music mediatype. diff -r e344426d7c28 -r 7a5f6ddd11b1 libpurple/protocols/msn/msn.c --- a/libpurple/protocols/msn/msn.c Mon Nov 24 05:51:18 2008 +0000 +++ b/libpurple/protocols/msn/msn.c Mon Nov 24 06:05:01 2008 +0000 @@ -705,11 +705,11 @@ if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { PurpleStatus *tune = purple_presence_get_status(presence, "tune"); const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE); - const char *artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST); - const char *album = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM); const char *game = purple_status_get_attr_string(tune, "game"); const char *office = purple_status_get_attr_string(tune, "office"); if (title && *title) { + const char *artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST); + const char *album = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM); mediatype = _("Now Listening"); currentmedia = purple_util_format_song_info(title, artist, album, NULL); } else if (game && *game) { diff -r e344426d7c28 -r 7a5f6ddd11b1 libpurple/protocols/msn/state.c --- a/libpurple/protocols/msn/state.c Mon Nov 24 05:51:18 2008 +0000 +++ b/libpurple/protocols/msn/state.c Mon Nov 24 06:05:01 2008 +0000 @@ -209,25 +209,26 @@ static char * create_media_string(PurplePresence *presence) { - const char *artist, *title, *album, *game, *office; + const char *title, *game, *office; char *ret; PurpleStatus *status = purple_presence_get_status(presence, "tune"); if (!status || !purple_status_is_active(status)) return g_strdup_printf("\\0Music\\00\\0\\0"); title = purple_status_get_attr_string(status, PURPLE_TUNE_TITLE); - artist = purple_status_get_attr_string(status, PURPLE_TUNE_ARTIST); - album = purple_status_get_attr_string(status, PURPLE_TUNE_ALBUM); game = purple_status_get_attr_string(status, "game"); office = purple_status_get_attr_string(status, "office"); - if (title && *title) + if (title && *title) { + const char *artist = purple_status_get_attr_string(status, PURPLE_TUNE_ARTIST); + const char *album = purple_status_get_attr_string(status, PURPLE_TUNE_ALBUM); ret = g_strdup_printf("WMP\\0Music\\01\\0{0}%s%s\\0%s\\0%s\\0%s\\0", artist ? " - {1}" : "", album ? " ({2})" : "", title, artist ? artist : "", album ? album : ""); + } else if (game && *game) ret = g_strdup_printf("\\0Games\\01\\0Playing {0}\\0%s\\0", game); else if (office && *office)