comparison libpurple/protocols/jabber/jabber.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 cacc01b50a23
children d63892ade0a6 9a60b9fab0ea
comparison
equal deleted inserted replaced
21999:b783b67f1469 22000:af0426c34c27
1521 purple_notify_user_info_add_pair(user_info, _("Mood"), moodplustext); 1521 purple_notify_user_info_add_pair(user_info, _("Mood"), moodplustext);
1522 g_free(moodplustext); 1522 g_free(moodplustext);
1523 } else 1523 } else
1524 purple_notify_user_info_add_pair(user_info, _("Mood"), mood); 1524 purple_notify_user_info_add_pair(user_info, _("Mood"), mood);
1525 } 1525 }
1526 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { 1526 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) {
1527 PurpleStatus *tune = purple_presence_get_status(presence, "tune"); 1527 PurpleStatus *tune = purple_presence_get_status(presence, "tune");
1528 const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE); 1528 const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE);
1529 purple_notify_user_info_add_pair(user_info, _("Current media"), title); 1529 const char *artist = purple_status_get_attr_string(tune, PURPLE_TUNE_ARTIST);
1530 const char *album = purple_status_get_attr_string(tune, PURPLE_TUNE_ALBUM);
1531 char *playing = purple_util_format_song_info(title, artist, album, NULL);
1532 if (playing) {
1533 purple_notify_user_info_add_pair(user_info, _("Now Listening"), playing);
1534 g_free(playing);
1535 }
1530 } 1536 }
1531 } 1537 }
1532 1538
1533 for(l=jb->resources; l; l = l->next) { 1539 for(l=jb->resources; l; l = l->next) {
1534 char *text = NULL; 1540 char *text = NULL;