From aa0a9df66c75433a465e44cd21a3ff380bc82f6e Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Fri, 25 Jan 2002 00:02:31 +0000 Subject: [PATCH] Make some prompts look nicer, and add sensible selection of the decryption key. --- commands.c | 24 ++++++++++++++++++++++-- smime.c | 4 ++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/commands.c b/commands.c index 6d462c4f..683bae02 100644 --- a/commands.c +++ b/commands.c @@ -88,8 +88,28 @@ int mutt_display_message (HEADER *cur) if (cur->security & ENCRYPT) { #ifdef HAVE_SMIME - if (cur->env->to && cur->security & APPLICATION_SMIME) - smime_getkeys (cur->env->to->mailbox); + if (cur->security & APPLICATION_SMIME) + { + ADDRESS *t; + int found = 0; + for (t = cur->env->to; !found && t; t = t->next) + if (mutt_addr_is_user (t)) + { + found = 1; + smime_getkeys (t->mailbox); + } + for (t = cur->env->cc; !found && t; t = t->next) + if (mutt_addr_is_user (t)) + { + found = 1; + smime_getkeys (t->mailbox); + } + if (!found && (t = mutt_default_from())) + { + smime_getkeys (t->mailbox); + rfc822_free_address (&t); + } + } #endif if(!crypt_valid_passphrase(cur->security)) return 0; diff --git a/smime.c b/smime.c index f9bc85d1..27ed3665 100644 --- a/smime.c +++ b/smime.c @@ -374,7 +374,7 @@ char* smime_ask_for_key (char *prompt, char *mailbox, short public) char qry[256]; char title[256]; - if (!prompt) prompt = _("Enter keyID:"); + if (!prompt) prompt = _("Enter keyID: "); snprintf(index_file, sizeof (index_file), "%s/.index", public ? NONULL(SmimeCertificates) : NONULL(SmimeKeys)); @@ -770,7 +770,7 @@ char *smime_findKeys (ADDRESS *to, ADDRESS *cc, ADDRESS *bcc) if ((keyID = smime_get_field_from_db (q->mailbox, NULL, 1, 1)) == NULL) { snprintf(buf, sizeof(buf), - _("Enter keyID for \'%s\':"), + _("Enter keyID for \'%s\': "), q->mailbox); keyID = smime_ask_for_key(buf, q->mailbox, 1); } -- 2.40.0