]> granicus.if.org Git - neomutt/commitdiff
Print an error message if an autocrypt key can't be found
authorKevin McCarthy <kevin@8t8.us>
Fri, 26 Jul 2019 22:59:47 +0000 (15:59 -0700)
committerRichard Russon <rich@flatcap.org>
Mon, 19 Aug 2019 23:14:27 +0000 (00:14 +0100)
Co-authored-by: Richard Russon <rich@flatcap.org>
autocrypt/autocrypt.c

index 276e53e64bc343d4dc98af52d00ad04f88b1947d..0216bdea20ae6946decf85127e37c68c9f4e7e2f 100644 (file)
@@ -500,7 +500,16 @@ enum AutocryptRec mutt_autocrypt_ui_recommendation(struct Email *hdr, char **key
   TAILQ_FOREACH(recip, &recips, entries)
   {
     if (mutt_autocrypt_db_peer_get(recip, &peer) <= 0)
+    {
+      if (keylist)
+        /* L10N:
+           %s is an email address.  Autocrypt is scanning for the keyids
+           to use to encrypt, but it can't find a valid keyid for this address.
+           The message is printed and they are returned to the compose menu.
+         */
+        mutt_message(_("No (valid) autocrypt key found for %s."), recip->mailbox);
       goto cleanup;
+    }
 
     if (mutt_autocrypt_gpgme_is_valid_key(peer->keyid))
     {
@@ -524,7 +533,11 @@ enum AutocryptRec mutt_autocrypt_ui_recommendation(struct Email *hdr, char **key
       all_encrypt = 0;
     }
     else
+    {
+      if (keylist)
+        mutt_message(_("No (valid) autocrypt key found for %s."), recip->mailbox);
       goto cleanup;
+    }
 
     if (mutt_buffer_len(keylist_buf))
       mutt_buffer_addch(keylist_buf, ' ');