Mercurial > pidgin.yaz
diff libpurple/protocols/msn/msn.c @ 22000:af0426c34c27
Utility functions to set and format song information. Closes #4398.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sat, 05 Jan 2008 11:08:48 +0000 |
parents | 1162bf342def |
children | 23fef20a0ef2 9a60b9fab0ea |
line wrap: on
line diff
--- a/libpurple/protocols/msn/msn.c Sat Jan 05 10:45:29 2008 +0000 +++ b/libpurple/protocols/msn/msn.c Sat Jan 05 11:08:48 2008 +0000 @@ -593,8 +593,8 @@ 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); - currentmedia = g_strdup_printf("%s%s%s", title, artist ? " - " : "", - artist ? artist : ""); + const char *album = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM); + currentmedia = purple_util_format_song_info(title, artist, album, NULL); /* We could probably just use user->media.title etc. here */ } @@ -643,9 +643,7 @@ } if (currentmedia) { - tmp = g_markup_escape_text(currentmedia, -1); - purple_notify_user_info_add_pair(user_info, _("Current media"), tmp); - g_free(tmp); + purple_notify_user_info_add_pair(user_info, _("Now Listening"), currentmedia); g_free(currentmedia); } }