# HG changeset patch # User Ethan Blanton # Date 1095299415 0 # Node ID 40676ea6775720261fdd00f8efeca645157ee947 # Parent 1ececa0e70727cbdf1fa7af178275d95265f74c4 [gaim-migrate @ 10965] A patch from Stu Tomlinson to keep SILC from asking the user to repeatedly set a key for a buddy. committer: Tailor Script diff -r 1ececa0e7072 -r 40676ea67757 src/protocols/silc/buddy.c --- a/src/protocols/silc/buddy.c Thu Sep 16 01:48:42 2004 +0000 +++ b/src/protocols/silc/buddy.c Thu Sep 16 01:50:15 2004 +0000 @@ -1020,7 +1020,7 @@ } /* Open file selector to select the public key. */ - gaim_request_file(NULL, _("Open..."), NULL, FALSE, + gaim_request_file(NULL, _("Open..."), "", FALSE, G_CALLBACK(silcgaim_add_buddy_ask_import), G_CALLBACK(silcgaim_add_buddy_ask_pk_cancel), r); } @@ -1148,6 +1148,8 @@ SilcUInt32 pk_len; const char *filename; + filename = gaim_blist_node_get_string((GaimBlistNode *)b, "public-key"); + /* If the buddy is offline/nonexistent, we will require user to associate a public key with the buddy or the buddy cannot be added. */ @@ -1158,7 +1160,12 @@ } r->offline = TRUE; - silcgaim_add_buddy_ask_pk(r); + /* If the user has already associated a public key, try loading it + * before prompting the user to load it again */ + if (filename != NULL) + silcgaim_add_buddy_ask_import(r, filename); + else + silcgaim_add_buddy_ask_pk(r); return; } @@ -1201,8 +1208,6 @@ b->proto_data = silc_memdup(clients[0]->id, sizeof(*clients[0]->id)); r->client_id = *clients[0]->id; - filename = gaim_blist_node_get_string((GaimBlistNode *)b, "public-key"); - /* Get the public key from attributes, if not present then resolve it with GETKEY unless we have it cached already. */ if (clients[0]->attrs && !clients[0]->public_key) {