Index: src/protocols/silc/buddy.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/silc/buddy.c,v retrieving revision 1.15 diff -u -p -r1.15 buddy.c --- src/protocols/silc/buddy.c 10 Jul 2004 18:38:20 -0000 1.15 +++ src/protocols/silc/buddy.c 28 Aug 2004 16:16:44 -0000 @@ -1020,7 +1020,7 @@ silcgaim_add_buddy_ask_pk_cb(SilcGaimBud } /* 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 @@ silcgaim_add_buddy_resolved(SilcClient c 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 @@ silcgaim_add_buddy_resolved(SilcClient c } 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 @@ silcgaim_add_buddy_resolved(SilcClient c 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) {