]> granicus.if.org Git - mutt/commitdiff
Make some prompts look nicer, and add sensible selection of the
authorThomas Roessler <roessler@does-not-exist.org>
Fri, 25 Jan 2002 00:02:31 +0000 (00:02 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Fri, 25 Jan 2002 00:02:31 +0000 (00:02 +0000)
decryption key.

commands.c
smime.c

index 6d462c4f279002f5baa1126c9b06dc7bac10235d..683bae02164421ce316f4d1314cd8db82503b612 100644 (file)
@@ -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 f9bc85d1714cb0ec4dfb204ca5f7ef1715d68992..27ed3665823611b528532168fd16de3d87879d38 100644 (file)
--- 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);
     }