diff 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
line wrap: on
line diff
--- a/src/protocols/silc/buddy.c	Sat Nov 19 18:09:51 2005 +0000
+++ b/src/protocols/silc/buddy.c	Sun Nov 20 00:59:36 2005 +0000
@@ -1109,8 +1109,9 @@
 	GaimRequestFields *fields;
 	GaimRequestFieldGroup *g;
 	GaimRequestField *f;
-	char tmp[512];
+	char tmp[512], tmp2[128];
 	int i;
+	char *fingerprint;
 
 	fields = gaim_request_fields_new();
 	g = gaim_request_field_group_new(NULL);
@@ -1120,11 +1121,19 @@
 	gaim_request_fields_add_group(fields, g);
 
 	for (i = 0; i < clients_count; i++) {
-		g_snprintf(tmp, sizeof(tmp), "%s - %s (%s@%s)",
+		fingerprint = NULL;
+		if (clients[i]->fingerprint) {
+			fingerprint = silc_fingerprint(clients[i]->fingerprint,
+						       clients[i]->fingerprint_len);
+			g_snprintf(tmp2, sizeof(tmp2), "\n%s", fingerprint);
+		}
+		g_snprintf(tmp, sizeof(tmp), "%s - %s (%s@%s)%s",
 			   clients[i]->realname, clients[i]->nickname,
 			   clients[i]->username, clients[i]->hostname ?
-			   clients[i]->hostname : "");
+			   clients[i]->hostname : "",
+			   fingerprint ? tmp2 : "");
 		gaim_request_field_list_add(f, tmp, clients[i]);
+		silc_free(fingerprint);
 	}
 
 	gaim_request_fields(r->client->application, _("Add Buddy"),
@@ -1615,12 +1624,13 @@
 		m = g_list_append(m, act);
 	}
 
-	wb = silc_calloc(1, sizeof(*wb));
-	wb->sg = sg;
-	wb->client_entry = client_entry;
-	act = gaim_blist_node_action_new(_("Draw On Whiteboard"),
-	                                 silcgaim_buddy_wb, (void *)wb, NULL);
-	m = g_list_append(m, act);
-
+	if (client_entry) {
+		wb = silc_calloc(1, sizeof(*wb));
+		wb->sg = sg;
+		wb->client_entry = client_entry;
+		act = gaim_blist_node_action_new(_("Draw On Whiteboard"),
+		                                 silcgaim_buddy_wb, (void *)wb, NULL);
+		m = g_list_append(m, act);
+	}
 	return m;
 }