comparison libpurple/util.c @ 22089:1e227e2587e6

Make setting 'now listening' actually work, thanks to khc.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 12 Jan 2008 22:05:52 +0000
parents 83613550512b
children 3634d27ec6f1
comparison
equal deleted inserted replaced
22088:51d6ae399919 22089:1e227e2587e6
4627 signal(SIGXFSZ, SIG_DFL); /* 25: exceeded file size limit */ 4627 signal(SIGXFSZ, SIG_DFL); /* 25: exceeded file size limit */
4628 #endif /* HAVE_SIGNAL_H */ 4628 #endif /* HAVE_SIGNAL_H */
4629 #endif /* !_WIN32 */ 4629 #endif /* !_WIN32 */
4630 } 4630 }
4631 4631
4632 static void
4633 set_status_with_attrs(PurpleStatus *status, ...)
4634 {
4635 va_list args;
4636 va_start(args, status);
4637 purple_status_set_active_with_attrs(status, TRUE, args);
4638 va_end(args);
4639 }
4640
4632 void purple_util_set_current_song(const char *title, const char *artist, const char *album) 4641 void purple_util_set_current_song(const char *title, const char *artist, const char *album)
4633 { 4642 {
4634 GList *list = purple_accounts_get_all(); 4643 GList *list = purple_accounts_get_all();
4635 for (; list; list = list->next) { 4644 for (; list; list = list->next) {
4636 PurplePresence *presence; 4645 PurplePresence *presence;
4642 presence = purple_account_get_presence(account); 4651 presence = purple_account_get_presence(account);
4643 tune = purple_presence_get_status(presence, "tune"); 4652 tune = purple_presence_get_status(presence, "tune");
4644 if (!tune) 4653 if (!tune)
4645 continue; 4654 continue;
4646 if (title) { 4655 if (title) {
4647 purple_status_set_active(tune, TRUE); 4656 set_status_with_attrs(tune,
4648 purple_status_set_attr_string(tune, PURPLE_TUNE_TITLE, title); 4657 PURPLE_TUNE_TITLE, title,
4649 purple_status_set_attr_string(tune, PURPLE_TUNE_ARTIST, artist); 4658 PURPLE_TUNE_ARTIST, artist,
4650 purple_status_set_attr_string(tune, PURPLE_TUNE_ALBUM, album); 4659 PURPLE_TUNE_ALBUM, album,
4660 NULL);
4651 } else { 4661 } else {
4652 purple_status_set_active(tune, FALSE); 4662 purple_status_set_active(tune, FALSE);
4653 } 4663 }
4654 } 4664 }
4655 } 4665 }