diff options
author | Kevin McCarthy <kevin@8t8.us> | 2020-05-14 15:42:38 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2020-05-14 15:42:38 -0700 |
commit | d1199f767a9a852a0fa5a6b308f4dd7ad20d9087 (patch) | |
tree | 45122f185a37e168678d94a062ef6a672c91d488 /autocrypt | |
parent | e3e0a0ba0d1fbe242111eae04da6084a821d5aca (diff) |
Add Autocrypt error messages when trying to force send.
If the account doesn't exist, or isn't enabled, display a message back
in the compose menu.
Diffstat (limited to 'autocrypt')
-rw-r--r-- | autocrypt/autocrypt.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/autocrypt/autocrypt.c b/autocrypt/autocrypt.c index d31529cc..dbdec273 100644 --- a/autocrypt/autocrypt.c +++ b/autocrypt/autocrypt.c @@ -527,16 +527,40 @@ autocrypt_rec_t mutt_autocrypt_ui_recommendation (HEADER *hdr, char **keylist) !hdr || !hdr->env->from || hdr->env->from->next) + { + if (keylist) + { + /* L10N: + Error displayed if the user tries to force sending an Autocrypt + email when the engine is not available. + */ + mutt_message (_("Autocrypt is not available.")); + } return AUTOCRYPT_REC_OFF; + } if (hdr->security & APPLICATION_SMIME) + { + if (keylist) + mutt_message (_("Autocrypt is not available.")); return AUTOCRYPT_REC_OFF; + } - if (mutt_autocrypt_db_account_get (hdr->env->from, &account) <= 0) - goto cleanup; - - if (!account->enabled) + if ((mutt_autocrypt_db_account_get (hdr->env->from, &account) <= 0) || + !account->enabled) + { + if (keylist) + { + /* L10N: + Error displayed if the user tries to force sending an Autocrypt + email when the account does not exist or is not enabled. + %s is the From email address used to look up the Autocrypt account. + */ + mutt_message (_("Autocrypt is not enabled for %s."), + NONULL (hdr->env->from->mailbox)); + } goto cleanup; + } keylist_buf = mutt_buffer_pool_get (); mutt_buffer_addstr (keylist_buf, account->keyid); |