| 965 default: |
965 default: |
| 966 break; |
966 break; |
| 967 } |
967 } |
| 968 } |
968 } |
| 969 |
969 |
| 970 #if 0 |
|
| 971 static void |
|
| 972 silcpurple_whois_more(SilcClientEntry client_entry, gint id) |
|
| 973 { |
|
| 974 SilcAttributePayload attr; |
|
| 975 SilcAttribute attribute; |
|
| 976 GString *s; |
|
| 977 SilcVCardStruct vcard; |
|
| 978 int i; |
|
| 979 |
|
| 980 if (id != 0) |
|
| 981 return; |
|
| 982 |
|
| 983 memset(&vcard, 0, sizeof(vcard)); |
|
| 984 |
|
| 985 s = g_string_new(""); |
|
| 986 |
|
| 987 silc_dlist_start(client_entry->attrs); |
|
| 988 while ((attr = silc_dlist_get(client_entry->attrs)) != SILC_LIST_END) { |
|
| 989 attribute = silc_attribute_get_attribute(attr); |
|
| 990 switch (attribute) { |
|
| 991 |
|
| 992 case SILC_ATTRIBUTE_USER_INFO: |
|
| 993 if (!silc_attribute_get_object(attr, (void *)&vcard, |
|
| 994 sizeof(vcard))) |
|
| 995 continue; |
|
| 996 g_string_append_printf(s, "%s:\n\n", _("Personal Information")); |
|
| 997 if (vcard.full_name) |
|
| 998 g_string_append_printf(s, "%s:\t\t%s\n", |
|
| 999 _("Full Name"), |
|
| 1000 vcard.full_name); |
|
| 1001 if (vcard.first_name) |
|
| 1002 g_string_append_printf(s, "%s:\t%s\n", |
|
| 1003 _("First Name"), |
|
| 1004 vcard.first_name); |
|
| 1005 if (vcard.middle_names) |
|
| 1006 g_string_append_printf(s, "%s:\t%s\n", |
|
| 1007 _("Middle Name"), |
|
| 1008 vcard.middle_names); |
|
| 1009 if (vcard.family_name) |
|
| 1010 g_string_append_printf(s, "%s:\t%s\n", |
|
| 1011 _("Family Name"), |
|
| 1012 vcard.family_name); |
|
| 1013 if (vcard.nickname) |
|
| 1014 g_string_append_printf(s, "%s:\t\t%s\n", |
|
| 1015 _("Nickname"), |
|
| 1016 vcard.nickname); |
|
| 1017 if (vcard.bday) |
|
| 1018 g_string_append_printf(s, "%s:\t\t%s\n", |
|
| 1019 _("Birth Day"), |
|
| 1020 vcard.bday); |
|
| 1021 if (vcard.title) |
|
| 1022 g_string_append_printf(s, "%s:\t\t%s\n", |
|
| 1023 _("Job Title"), |
|
| 1024 vcard.title); |
|
| 1025 if (vcard.role) |
|
| 1026 g_string_append_printf(s, "%s:\t\t%s\n", |
|
| 1027 _("Job Role"), |
|
| 1028 vcard.role); |
|
| 1029 if (vcard.org_name) |
|
| 1030 g_string_append_printf(s, "%s:\t%s\n", |
|
| 1031 _("Organization"), |
|
| 1032 vcard.org_name); |
|
| 1033 if (vcard.org_unit) |
|
| 1034 g_string_append_printf(s, "%s:\t\t%s\n", |
|
| 1035 _("Unit"), |
|
| 1036 vcard.org_unit); |
|
| 1037 if (vcard.url) |
|
| 1038 g_string_append_printf(s, "%s:\t%s\n", |
|
| 1039 _("Homepage"), |
|
| 1040 vcard.url); |
|
| 1041 if (vcard.label) |
|
| 1042 g_string_append_printf(s, "%s:\t%s\n", |
|
| 1043 _("Address"), |
|
| 1044 vcard.label); |
|
| 1045 for (i = 0; i < vcard.num_tels; i++) { |
|
| 1046 if (vcard.tels[i].telnum) |
|
| 1047 g_string_append_printf(s, "%s:\t\t\t%s\n", |
|
| 1048 _("Phone"), |
|
| 1049 vcard.tels[i].telnum); |
|
| 1050 } |
|
| 1051 for (i = 0; i < vcard.num_emails; i++) { |
|
| 1052 if (vcard.emails[i].address) |
|
| 1053 g_string_append_printf(s, "%s:\t\t%s\n", |
|
| 1054 _("Email"), |
|
| 1055 vcard.emails[i].address); |
|
| 1056 } |
|
| 1057 if (vcard.note) |
|
| 1058 g_string_append_printf(s, "\n%s:\t\t%s\n", |
|
| 1059 _("Note"), |
|
| 1060 vcard.note); |
|
| 1061 break; |
|
| 1062 } |
|
| 1063 } |
|
| 1064 |
|
| 1065 purple_notify_info(NULL, _("User Information"), _("User Information"), |
|
| 1066 s->str); |
|
| 1067 g_string_free(s, TRUE); |
|
| 1068 } |
|
| 1069 #endif |
|
| 1070 |
|
| 1071 |
970 |
| 1072 /* Command reply handler. Delivers a reply to command that was sent |
971 /* Command reply handler. Delivers a reply to command that was sent |
| 1073 earlier. The `conn' is the associated client connection. The `command' |
972 earlier. The `conn' is the associated client connection. The `command' |
| 1074 indicates the command reply type. If the `status' other than |
973 indicates the command reply type. If the `status' other than |
| 1075 SILC_STATUS_OK an error occurred. In this case the `error' will indicate |
974 SILC_STATUS_OK an error occurred. In this case the `error' will indicate |
| 1304 silc_free(babbleprint); |
1203 silc_free(babbleprint); |
| 1305 silc_free(pk); |
1204 silc_free(pk); |
| 1306 } |
1205 } |
| 1307 } |
1206 } |
| 1308 |
1207 |
| 1309 #if 0 /* XXX for now, let's not show attrs here */ |
|
| 1310 if (client_entry->attrs) |
|
| 1311 purple_request_action(gc, _("User Information"), |
|
| 1312 _("User Information"), |
|
| 1313 buf, 1, client_entry, 2, |
|
| 1314 _("OK"), G_CALLBACK(silcpurple_whois_more), |
|
| 1315 _("_More..."), G_CALLBACK(silcpurple_whois_more), gc->account, NULL, NULL); |
|
| 1316 else |
|
| 1317 #endif /* 0 */ |
|
| 1318 purple_notify_userinfo(gc, client_entry->nickname, user_info, NULL, NULL); |
1208 purple_notify_userinfo(gc, client_entry->nickname, user_info, NULL, NULL); |
| 1319 purple_notify_user_info_destroy(user_info); |
1209 purple_notify_user_info_destroy(user_info); |
| 1320 } |
1210 } |
| 1321 break; |
1211 break; |
| 1322 |
1212 |