Mercurial > pidgin
comparison libgaim/protocols/silc/buddy.c @ 15172:fed5a2527dd3
[gaim-migrate @ 17958]
Update silc for tooltip API changes.
committer: Tailor Script <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Mon, 11 Dec 2006 13:30:30 +0000 |
parents | 60b1bc8dbf37 |
children |
comparison
equal
deleted
inserted
replaced
15171:a00712d0522e | 15172:fed5a2527dd3 |
---|---|
1507 } | 1507 } |
1508 | 1508 |
1509 return NULL; | 1509 return NULL; |
1510 } | 1510 } |
1511 | 1511 |
1512 void silcgaim_tooltip_text(GaimBuddy *b, GString *str, gboolean full) | 1512 void silcgaim_tooltip_text(GaimBuddy *b, GaimNotifyUserInfo *user_info, gboolean full) |
1513 { | 1513 { |
1514 SilcGaim sg = b->account->gc->proto_data; | 1514 SilcGaim sg = b->account->gc->proto_data; |
1515 SilcClient client = sg->client; | 1515 SilcClient client = sg->client; |
1516 SilcClientConnection conn = sg->conn; | 1516 SilcClientConnection conn = sg->conn; |
1517 SilcClientID *client_id = b->proto_data; | 1517 SilcClientID *client_id = b->proto_data; |
1520 char tmp[256]; | 1520 char tmp[256]; |
1521 | 1521 |
1522 /* Get the client entry. */ | 1522 /* Get the client entry. */ |
1523 client_entry = silc_client_get_client_by_id(client, conn, client_id); | 1523 client_entry = silc_client_get_client_by_id(client, conn, client_id); |
1524 if (!client_entry) | 1524 if (!client_entry) |
1525 return; | 1525 return; |
1526 | 1526 |
1527 if (client_entry->nickname) | 1527 if (client_entry->nickname) |
1528 g_string_append_printf(str, "\n<b>%s:</b> %s", _("Nickname"), | 1528 gaim_notify_user_info_add_pair(user_info, _("Nickname"), |
1529 client_entry->nickname); | 1529 client_entry->nickname); |
1530 if (client_entry->username && client_entry->hostname) | 1530 if (client_entry->username && client_entry->hostname) { |
1531 g_string_append_printf(str, "\n<b>%s:</b> %s@%s", _("Username"), | 1531 g_snprintf(tmp, sizeof(tmp), "%s@%s", client_entry->username, client_entry->hostname); |
1532 client_entry->username, client_entry->hostname); | 1532 gaim_notify_user_info_add_pair(user_info, _("Username"), tmp); |
1533 } | |
1533 if (client_entry->mode) { | 1534 if (client_entry->mode) { |
1534 g_string_append_printf(str, "\n<b>%s:</b> ", _("User Modes")); | 1535 memset(tmp, 0, sizeof(tmp)); |
1535 memset(tmp, 0, sizeof(tmp)); | 1536 silcgaim_get_umode_string(client_entry->mode, |
1536 silcgaim_get_umode_string(client_entry->mode, | 1537 tmp, sizeof(tmp) - strlen(tmp)); |
1537 tmp, sizeof(tmp) - strlen(tmp)); | 1538 gaim_notify_user_info_add_pair(user_info, _("User Modes"), tmp); |
1538 g_string_append_printf(str, "%s", tmp); | |
1539 } | 1539 } |
1540 | 1540 |
1541 silcgaim_parse_attrs(client_entry->attrs, &moodstr, &statusstr, &contactstr, &langstr, &devicestr, &tzstr, &geostr); | 1541 silcgaim_parse_attrs(client_entry->attrs, &moodstr, &statusstr, &contactstr, &langstr, &devicestr, &tzstr, &geostr); |
1542 | 1542 |
1543 if (statusstr) { | 1543 if (statusstr) { |
1544 g_string_append_printf(str, "\n<b>%s:</b> %s", _("Message"), statusstr); | 1544 gaim_notify_user_info_add_pair(user_info, _("Message"), statusstr); |
1545 g_free(statusstr); | 1545 g_free(statusstr); |
1546 } | 1546 } |
1547 | 1547 |
1548 if (full) { | 1548 if (full) { |
1549 if (moodstr) { | 1549 if (moodstr) { |
1550 g_string_append_printf(str, "\n<b>%s:</b> %s", _("Mood"), moodstr); | 1550 gaim_notify_user_info_add_pair(user_info, _("Mood"), moodstr); |
1551 g_free(moodstr); | 1551 g_free(moodstr); |
1552 } | 1552 } |
1553 | 1553 |
1554 if (contactstr) { | 1554 if (contactstr) { |
1555 g_string_append_printf(str, "\n<b>%s:</b> %s", _("Preferred Contact"), contactstr); | 1555 gaim_notify_user_info_add_pair(user_info, _("Preferred Contact"), contactstr); |
1556 g_free(contactstr); | 1556 g_free(contactstr); |
1557 } | 1557 } |
1558 | 1558 |
1559 if (langstr) { | 1559 if (langstr) { |
1560 g_string_append_printf(str, "\n<b>%s:</b> %s", _("Preferred Language"), langstr); | 1560 gaim_notify_user_info_add_pair(user_info, _("Preferred Language"), langstr); |
1561 g_free(langstr); | 1561 g_free(langstr); |
1562 } | 1562 } |
1563 | 1563 |
1564 if (devicestr) { | 1564 if (devicestr) { |
1565 g_string_append_printf(str, "\n<b>%s:</b> %s", _("Device"), devicestr); | 1565 gaim_notify_user_info_add_pair(user_info, _("Device"), devicestr); |
1566 g_free(devicestr); | 1566 g_free(devicestr); |
1567 } | 1567 } |
1568 | 1568 |
1569 if (tzstr) { | 1569 if (tzstr) { |
1570 g_string_append_printf(str, "\n<b>%s:</b> %s", _("Timezone"), tzstr); | 1570 gaim_notify_user_info_add_pair(user_info, _("Timezone"), tzstr); |
1571 g_free(tzstr); | 1571 g_free(tzstr); |
1572 } | 1572 } |
1573 | 1573 |
1574 if (geostr) { | 1574 if (geostr) { |
1575 g_string_append_printf(str, "\n<b>%s:</b> %s", _("Geolocation"), geostr); | 1575 gaim_notify_user_info_add_pair(user_info, _("Geolocation"), geostr); |
1576 g_free(geostr); | 1576 g_free(geostr); |
1577 } | 1577 } |
1578 } | 1578 } |
1579 } | 1579 } |
1580 | 1580 |