comparison libpurple/protocols/silc/buddy.c @ 32363:3322201b446f

I went through all our calls to purple_notify_user_info_add_pair() and checked whether they should be purple_notify_user_info_add_pair_plaintext(), instead. If it wasn't immediately obvious one way or the other then I left a comment to investigate. I suspect there are still a lot of places where we should use the _plaintext function to escape the value.
author Mark Doliner <mark@kingant.net>
date Mon, 22 Aug 2011 01:53:37 +0000
parents a538cb73f897
children 99ca503ea087
comparison
equal deleted inserted replaced
32362:57d43a9a4e7e 32363:3322201b446f
1545 client_entry = silc_client_get_client_by_id(client, conn, client_id); 1545 client_entry = silc_client_get_client_by_id(client, conn, client_id);
1546 if (!client_entry) 1546 if (!client_entry)
1547 return; 1547 return;
1548 1548
1549 if (client_entry->nickname) 1549 if (client_entry->nickname)
1550 /* TODO: Check whether it's correct to call add_pair_html,
1551 or if we should be using add_pair_plaintext */
1550 purple_notify_user_info_add_pair(user_info, _("Nickname"), 1552 purple_notify_user_info_add_pair(user_info, _("Nickname"),
1551 client_entry->nickname); 1553 client_entry->nickname);
1552 if (client_entry->username && client_entry->hostname) { 1554 if (client_entry->username && client_entry->hostname) {
1553 g_snprintf(tmp, sizeof(tmp), "%s@%s", client_entry->username, client_entry->hostname); 1555 g_snprintf(tmp, sizeof(tmp), "%s@%s", client_entry->username, client_entry->hostname);
1556 /* TODO: Check whether it's correct to call add_pair_html,
1557 or if we should be using add_pair_plaintext */
1554 purple_notify_user_info_add_pair(user_info, _("Username"), tmp); 1558 purple_notify_user_info_add_pair(user_info, _("Username"), tmp);
1555 } 1559 }
1556 if (client_entry->mode) { 1560 if (client_entry->mode) {
1557 memset(tmp, 0, sizeof(tmp)); 1561 memset(tmp, 0, sizeof(tmp));
1558 silcpurple_get_umode_string(client_entry->mode, 1562 silcpurple_get_umode_string(client_entry->mode,
1559 tmp, sizeof(tmp) - strlen(tmp)); 1563 tmp, sizeof(tmp) - strlen(tmp));
1560 purple_notify_user_info_add_pair(user_info, _("User Modes"), tmp); 1564 purple_notify_user_info_add_pair_plaintext(user_info, _("User Modes"), tmp);
1561 } 1565 }
1562 1566
1563 silcpurple_parse_attrs(client_entry->attrs, &moodstr, &statusstr, &contactstr, &langstr, &devicestr, &tzstr, &geostr); 1567 silcpurple_parse_attrs(client_entry->attrs, &moodstr, &statusstr, &contactstr, &langstr, &devicestr, &tzstr, &geostr);
1564 1568
1565 if (statusstr) { 1569 if (statusstr) {
1570 /* TODO: Check whether it's correct to call add_pair_html,
1571 or if we should be using add_pair_plaintext */
1566 purple_notify_user_info_add_pair(user_info, _("Message"), statusstr); 1572 purple_notify_user_info_add_pair(user_info, _("Message"), statusstr);
1567 g_free(statusstr); 1573 g_free(statusstr);
1568 } 1574 }
1569 1575
1570 if (full) { 1576 if (full) {
1571 if (moodstr) { 1577 if (moodstr) {
1578 /* TODO: Check whether it's correct to call add_pair_html,
1579 or if we should be using add_pair_plaintext */
1572 purple_notify_user_info_add_pair(user_info, _("Mood"), moodstr); 1580 purple_notify_user_info_add_pair(user_info, _("Mood"), moodstr);
1573 g_free(moodstr); 1581 g_free(moodstr);
1574 } 1582 }
1575 1583
1576 if (contactstr) { 1584 if (contactstr) {
1585 /* TODO: Check whether it's correct to call add_pair_html,
1586 or if we should be using add_pair_plaintext */
1577 purple_notify_user_info_add_pair(user_info, _("Preferred Contact"), contactstr); 1587 purple_notify_user_info_add_pair(user_info, _("Preferred Contact"), contactstr);
1578 g_free(contactstr); 1588 g_free(contactstr);
1579 } 1589 }
1580 1590
1581 if (langstr) { 1591 if (langstr) {
1592 /* TODO: Check whether it's correct to call add_pair_html,
1593 or if we should be using add_pair_plaintext */
1582 purple_notify_user_info_add_pair(user_info, _("Preferred Language"), langstr); 1594 purple_notify_user_info_add_pair(user_info, _("Preferred Language"), langstr);
1583 g_free(langstr); 1595 g_free(langstr);
1584 } 1596 }
1585 1597
1586 if (devicestr) { 1598 if (devicestr) {
1599 /* TODO: Check whether it's correct to call add_pair_html,
1600 or if we should be using add_pair_plaintext */
1587 purple_notify_user_info_add_pair(user_info, _("Device"), devicestr); 1601 purple_notify_user_info_add_pair(user_info, _("Device"), devicestr);
1588 g_free(devicestr); 1602 g_free(devicestr);
1589 } 1603 }
1590 1604
1591 if (tzstr) { 1605 if (tzstr) {
1606 /* TODO: Check whether it's correct to call add_pair_html,
1607 or if we should be using add_pair_plaintext */
1592 purple_notify_user_info_add_pair(user_info, _("Timezone"), tzstr); 1608 purple_notify_user_info_add_pair(user_info, _("Timezone"), tzstr);
1593 g_free(tzstr); 1609 g_free(tzstr);
1594 } 1610 }
1595 1611
1596 if (geostr) { 1612 if (geostr) {
1613 /* TODO: Check whether it's correct to call add_pair_html,
1614 or if we should be using add_pair_plaintext */
1597 purple_notify_user_info_add_pair(user_info, _("Geolocation"), geostr); 1615 purple_notify_user_info_add_pair(user_info, _("Geolocation"), geostr);
1598 g_free(geostr); 1616 g_free(geostr);
1599 } 1617 }
1600 } 1618 }
1601 } 1619 }