comparison src/protocols/silc/buddy.c @ 12167:5851a9219bc7

[gaim-migrate @ 14468] Some SILC fixes from Pekka for whiteboard support, preferences, and documentation. Let's hear a big thanks to Pekka for keeping up with this stuff! Enclosed patch fixes couple crashbugs from the SILC whiteboard code, fixes the preferences (which are not used anymore in Gaim) by eliminating some of the old preferences and moving some of the preferences to account options, and introduces Create SILC Key Pair protocol action which can be used to generate new SILC key pair from Gaim. committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Sun, 20 Nov 2005 00:59:36 +0000
parents b528f37d8e95
children e4e47871c373
comparison
equal deleted inserted replaced
12166:d6417efb990c 12167:5851a9219bc7
1107 SilcUInt32 clients_count) 1107 SilcUInt32 clients_count)
1108 { 1108 {
1109 GaimRequestFields *fields; 1109 GaimRequestFields *fields;
1110 GaimRequestFieldGroup *g; 1110 GaimRequestFieldGroup *g;
1111 GaimRequestField *f; 1111 GaimRequestField *f;
1112 char tmp[512]; 1112 char tmp[512], tmp2[128];
1113 int i; 1113 int i;
1114 char *fingerprint;
1114 1115
1115 fields = gaim_request_fields_new(); 1116 fields = gaim_request_fields_new();
1116 g = gaim_request_field_group_new(NULL); 1117 g = gaim_request_field_group_new(NULL);
1117 f = gaim_request_field_list_new("list", NULL); 1118 f = gaim_request_field_list_new("list", NULL);
1118 gaim_request_field_group_add_field(g, f); 1119 gaim_request_field_group_add_field(g, f);
1119 gaim_request_field_list_set_multi_select(f, FALSE); 1120 gaim_request_field_list_set_multi_select(f, FALSE);
1120 gaim_request_fields_add_group(fields, g); 1121 gaim_request_fields_add_group(fields, g);
1121 1122
1122 for (i = 0; i < clients_count; i++) { 1123 for (i = 0; i < clients_count; i++) {
1123 g_snprintf(tmp, sizeof(tmp), "%s - %s (%s@%s)", 1124 fingerprint = NULL;
1125 if (clients[i]->fingerprint) {
1126 fingerprint = silc_fingerprint(clients[i]->fingerprint,
1127 clients[i]->fingerprint_len);
1128 g_snprintf(tmp2, sizeof(tmp2), "\n%s", fingerprint);
1129 }
1130 g_snprintf(tmp, sizeof(tmp), "%s - %s (%s@%s)%s",
1124 clients[i]->realname, clients[i]->nickname, 1131 clients[i]->realname, clients[i]->nickname,
1125 clients[i]->username, clients[i]->hostname ? 1132 clients[i]->username, clients[i]->hostname ?
1126 clients[i]->hostname : ""); 1133 clients[i]->hostname : "",
1134 fingerprint ? tmp2 : "");
1127 gaim_request_field_list_add(f, tmp, clients[i]); 1135 gaim_request_field_list_add(f, tmp, clients[i]);
1136 silc_free(fingerprint);
1128 } 1137 }
1129 1138
1130 gaim_request_fields(r->client->application, _("Add Buddy"), 1139 gaim_request_fields(r->client->application, _("Add Buddy"),
1131 _("Select correct user"), 1140 _("Select correct user"),
1132 r->pubkey_search 1141 r->pubkey_search
1613 act = gaim_blist_node_action_new(_("Kill User"), 1622 act = gaim_blist_node_action_new(_("Kill User"),
1614 silcgaim_buddy_kill, NULL, NULL); 1623 silcgaim_buddy_kill, NULL, NULL);
1615 m = g_list_append(m, act); 1624 m = g_list_append(m, act);
1616 } 1625 }
1617 1626
1618 wb = silc_calloc(1, sizeof(*wb)); 1627 if (client_entry) {
1619 wb->sg = sg; 1628 wb = silc_calloc(1, sizeof(*wb));
1620 wb->client_entry = client_entry; 1629 wb->sg = sg;
1621 act = gaim_blist_node_action_new(_("Draw On Whiteboard"), 1630 wb->client_entry = client_entry;
1622 silcgaim_buddy_wb, (void *)wb, NULL); 1631 act = gaim_blist_node_action_new(_("Draw On Whiteboard"),
1623 m = g_list_append(m, act); 1632 silcgaim_buddy_wb, (void *)wb, NULL);
1624 1633 m = g_list_append(m, act);
1634 }
1625 return m; 1635 return m;
1626 } 1636 }