Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/jabber.c @ 20571:c97e3ab9ef11
Music support for Google Talk
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Thu, 20 Sep 2007 23:22:35 +0000 |
parents | 5913725cbcd6 |
children | ba6cd9c25853 |
comparison
equal
deleted
inserted
replaced
20570:5913725cbcd6 | 20571:c97e3ab9ef11 |
---|---|
1398 ret = g_strdup(jb->error_msg); | 1398 ret = g_strdup(jb->error_msg); |
1399 } else { | 1399 } else { |
1400 char *stripped; | 1400 char *stripped; |
1401 | 1401 |
1402 if(!(stripped = purple_markup_strip_html(jabber_buddy_get_status_msg(jb)))) { | 1402 if(!(stripped = purple_markup_strip_html(jabber_buddy_get_status_msg(jb)))) { |
1403 PurpleStatus *status = purple_presence_get_active_status(purple_buddy_get_presence(b)); | 1403 PurplePresence *presence = purple_buddy_get_presence(b); |
1404 | 1404 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { |
1405 if(!purple_status_is_available(status)) | 1405 PurpleStatus *status = purple_presence_get_status(presence, "tune"); |
1406 stripped = g_strdup(purple_status_get_name(status)); | 1406 stripped = g_strdup(purple_status_get_attr_string(status, PURPLE_TUNE_TITLE)); |
1407 } | |
1407 } | 1408 } |
1408 | 1409 |
1409 if(stripped) { | 1410 if(stripped) { |
1410 ret = g_markup_escape_text(stripped, -1); | 1411 ret = g_markup_escape_text(stripped, -1); |
1411 g_free(stripped); | 1412 g_free(stripped); |
1427 jb = jabber_buddy_find(b->account->gc->proto_data, b->name, | 1428 jb = jabber_buddy_find(b->account->gc->proto_data, b->name, |
1428 FALSE); | 1429 FALSE); |
1429 | 1430 |
1430 if(jb) { | 1431 if(jb) { |
1431 JabberBuddyResource *jbr = NULL; | 1432 JabberBuddyResource *jbr = NULL; |
1433 PurplePresence *presence = purple_buddy_get_presence(b); | |
1432 const char *sub; | 1434 const char *sub; |
1433 GList *l; | 1435 GList *l; |
1434 const char *mood; | 1436 const char *mood; |
1435 | 1437 |
1436 if (full) { | 1438 if (full) { |
1453 sub = _("None"); | 1455 sub = _("None"); |
1454 } | 1456 } |
1455 | 1457 |
1456 purple_notify_user_info_add_pair(user_info, _("Subscription"), sub); | 1458 purple_notify_user_info_add_pair(user_info, _("Subscription"), sub); |
1457 | 1459 |
1458 status = purple_presence_get_active_status(purple_buddy_get_presence(b)); | 1460 status = purple_presence_get_active_status(presence); |
1459 value = purple_status_get_attr_value(status, "mood"); | 1461 value = purple_status_get_attr_value(status, "mood"); |
1460 if (value && purple_value_get_type(value) == PURPLE_TYPE_STRING && (mood = purple_value_get_string(value))) { | 1462 if (value && purple_value_get_type(value) == PURPLE_TYPE_STRING && (mood = purple_value_get_string(value))) { |
1461 | 1463 |
1462 value = purple_status_get_attr_value(status, "moodtext"); | 1464 value = purple_status_get_attr_value(status, "moodtext"); |
1463 if(value && purple_value_get_type(value) == PURPLE_TYPE_STRING) { | 1465 if(value && purple_value_get_type(value) == PURPLE_TYPE_STRING) { |
1465 | 1467 |
1466 purple_notify_user_info_add_pair(user_info, _("Mood"), moodplustext); | 1468 purple_notify_user_info_add_pair(user_info, _("Mood"), moodplustext); |
1467 g_free(moodplustext); | 1469 g_free(moodplustext); |
1468 } else | 1470 } else |
1469 purple_notify_user_info_add_pair(user_info, _("Mood"), mood); | 1471 purple_notify_user_info_add_pair(user_info, _("Mood"), mood); |
1470 } | 1472 } |
1473 if (purple_presence_is_status_primitive_active(presence, PURPLE_STATUS_TUNE)) { | |
1474 PurpleStatus *tune = purple_presence_get_status(presence, "tune"); | |
1475 const char *title = purple_status_get_attr_string(tune, PURPLE_TUNE_TITLE); | |
1476 purple_notify_user_info_add_pair(user_info, _("Current media"), title); | |
1477 } | |
1471 } | 1478 } |
1472 | 1479 |
1473 for(l=jb->resources; l; l = l->next) { | 1480 for(l=jb->resources; l; l = l->next) { |
1474 char *text = NULL; | 1481 char *text = NULL; |
1475 char *res = NULL; | 1482 char *res = NULL; |