libgaim/protocols/novell/novell.c

changeset 15205
f642029b2f97
parent 15185
74b689a74430
child 20470
77693555855f
child 20472
6a6d2ef151e6
equal deleted inserted replaced
15204:6775ac53169c 15205:f642029b2f97
1492 1492
1493 /* Display a dialog box showing the properties for the given user record */ 1493 /* Display a dialog box showing the properties for the given user record */
1494 static void 1494 static void
1495 _show_info(GaimConnection * gc, NMUserRecord * user_record) 1495 _show_info(GaimConnection * gc, NMUserRecord * user_record)
1496 { 1496 {
1497 GaimNotifyUserInfo *user_info = gaim_notify_user_info_new();
1497 GString *info_text; 1498 GString *info_text;
1498 int count, i; 1499 int count, i;
1499 NMProperty *property; 1500 NMProperty *property;
1500 const char *tag, *value; 1501 const char *tag, *value;
1501 1502
1502 info_text = g_string_new(""); 1503 info_text = g_string_new("");
1503 1504
1504 tag = _("User ID"); 1505 tag = _("User ID");
1505 value = nm_user_record_get_userid(user_record); 1506 value = nm_user_record_get_userid(user_record);
1506 if (value) { 1507 if (value) {
1507 g_string_append_printf(info_text, "<b>%s:</b> %s<br>", tag, value); 1508 gaim_notify_user_info_add_pair(user_info, tag, value);
1508 } 1509 }
1509 1510
1510 /* tag = _("DN"); 1511 /* tag = _("DN");
1511 value = nm_user_record_get_dn(user_record); 1512 value = nm_user_record_get_dn(user_record);
1512 if (value) { 1513 if (value) {
1513 g_string_append_printf(info_text, "<b>%s:</b> %s<br>", 1514 gaim_notify_user_info_add_pair(user_info, tag, value);
1514 tag, value);
1515 } 1515 }
1516 */ 1516 */
1517 1517
1518 tag = _("Full name"); 1518 tag = _("Full name");
1519 value = nm_user_record_get_full_name(user_record); 1519 value = nm_user_record_get_full_name(user_record);
1520 if (value) { 1520 if (value) {
1521 g_string_append_printf(info_text, "<b>%s:</b> %s<br>", tag, value); 1521 gaim_notify_user_info_add_pair(user_info, tag, value);
1522 } 1522 }
1523 1523
1524 count = nm_user_record_get_property_count(user_record); 1524 count = nm_user_record_get_property_count(user_record);
1525 for (i = 0; i < count; i++) { 1525 for (i = 0; i < count; i++) {
1526 property = nm_user_record_get_property(user_record, i); 1526 property = nm_user_record_get_property(user_record, i);
1527 if (property) { 1527 if (property) {
1528 tag = _map_property_tag(nm_property_get_tag(property)); 1528 tag = _map_property_tag(nm_property_get_tag(property));
1529 value = nm_property_get_value(property); 1529 value = nm_property_get_value(property);
1530 if (tag && value) { 1530 if (tag && value) {
1531 g_string_append_printf(info_text, "<b>%s:</b> %s<br>", 1531 gaim_notify_user_info_add_pair(user_info, tag, value);
1532 tag, value);
1533 } 1532 }
1534 nm_release_property(property); 1533 nm_release_property(property);
1535 } 1534 }
1536 } 1535 }
1537 1536
1538 gaim_notify_userinfo(gc, nm_user_record_get_userid(user_record), 1537 gaim_notify_userinfo(gc, nm_user_record_get_userid(user_record),
1539 info_text->str, NULL, NULL); 1538 user_info, NULL, NULL);
1540 1539 gaim_notify_user_info_destroy(user_info);
1541 g_string_free(info_text, TRUE);
1542 } 1540 }
1543 1541
1544 /* Send a join conference, the first item in the parms list is the 1542 /* Send a join conference, the first item in the parms list is the
1545 * NMUser object and the second item is the conference to join. 1543 * NMUser object and the second item is the conference to join.
1546 * This callback is passed to gaim_request_action when we ask the 1544 * This callback is passed to gaim_request_action when we ask the
2824 { 2822 {
2825 return "novell"; 2823 return "novell";
2826 } 2824 }
2827 2825
2828 static void 2826 static void
2829 novell_tooltip_text(GaimBuddy * buddy, GString * str, gboolean full) 2827 novell_tooltip_text(GaimBuddy * buddy, GaimNotifyUserInfo * user_info, gboolean full)
2830 { 2828 {
2831 NMUserRecord *user_record = NULL; 2829 NMUserRecord *user_record = NULL;
2832 GaimConnection *gc; 2830 GaimConnection *gc;
2833 NMUser *user; 2831 NMUser *user;
2834 int status = 0; 2832 int status = 0;
2867 default: 2865 default:
2868 status_str = _("Unknown"); 2866 status_str = _("Unknown");
2869 break; 2867 break;
2870 } 2868 }
2871 2869
2870 gaim_notify_user_info_add_pair(user_info, _("Status"), status_str);
2871
2872 if (text) 2872 if (text)
2873 g_string_append_printf(str, "\n<b>%s:</b> %s" 2873 gaim_notify_user_info_add_pair(user_info, _("Message"), text);
2874 "\n<b>%s:</b> %s",
2875 _("Status"), status_str,
2876 _("Message"), text);
2877 else
2878 g_string_append_printf(str, "\n<b>%s:</b> %s",
2879 _("Status"), status_str);
2880 } 2874 }
2881 } 2875 }
2882 } 2876 }
2883 2877
2884 static void 2878 static void

mercurial