Mercurial > pidgin
comparison 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 |
comparison
equal
deleted
inserted
replaced
21999:b783b67f1469 | 22000:af0426c34c27 |
---|---|
591 psm = purple_status_get_attr_string(status, "message"); | 591 psm = purple_status_get_attr_string(status, "message"); |
592 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { | 592 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { |
593 PurpleStatus *tune = purple_presence_get_status(presence, "tune"); | 593 PurpleStatus *tune = purple_presence_get_status(presence, "tune"); |
594 const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE); | 594 const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE); |
595 const char *artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST); | 595 const char *artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST); |
596 currentmedia = g_strdup_printf("%s%s%s", title, artist ? " - " : "", | 596 const char *album = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM); |
597 artist ? artist : ""); | 597 currentmedia = purple_util_format_song_info(title, artist, album, NULL); |
598 /* We could probably just use user->media.title etc. here */ | 598 /* We could probably just use user->media.title etc. here */ |
599 } | 599 } |
600 | 600 |
601 if (!purple_status_is_available(status)) { | 601 if (!purple_status_is_available(status)) { |
602 name = purple_status_get_name(status); | 602 name = purple_status_get_name(status); |
641 } | 641 } |
642 } | 642 } |
643 } | 643 } |
644 | 644 |
645 if (currentmedia) { | 645 if (currentmedia) { |
646 tmp = g_markup_escape_text(currentmedia, -1); | 646 purple_notify_user_info_add_pair(user_info, _("Now Listening"), currentmedia); |
647 purple_notify_user_info_add_pair(user_info, _("Current media"), tmp); | |
648 g_free(tmp); | |
649 g_free(currentmedia); | 647 g_free(currentmedia); |
650 } | 648 } |
651 } | 649 } |
652 | 650 |
653 /* XXX: This is being shown in non-full tooltips because the | 651 /* XXX: This is being shown in non-full tooltips because the |