From: Kevin McCarthy Date: Sat, 27 Jul 2019 22:11:38 +0000 (-0700) Subject: Add prefer-encrypt prompt during account creation X-Git-Tag: 2019-10-25~97^2~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a96855638f6aa7fad99052c2318dcbcbae4ec3d2;p=neomutt Add prefer-encrypt prompt during account creation Co-authored-by: Richard Russon --- diff --git a/autocrypt/autocrypt.c b/autocrypt/autocrypt.c index 42cf5d457..5ccbf1130 100644 --- a/autocrypt/autocrypt.c +++ b/autocrypt/autocrypt.c @@ -111,6 +111,7 @@ int mutt_autocrypt_account_init(void) struct AutocryptAccount *account = NULL; bool done = false; int rc = -1; + int prefer_encrypt = 0; mutt_debug(LL_DEBUG1, "In mutt_autocrypt_account_init\n"); if (mutt_yesorno(_("Create an initial autocrypt account?"), MUTT_YES) != MUTT_YES) @@ -166,8 +167,18 @@ int mutt_autocrypt_account_init(void) if (mutt_autocrypt_gpgme_create_key(addr, keyid, keydata)) goto cleanup; - /* TODO: prompt for prefer_encrypt value? */ - if (mutt_autocrypt_db_account_insert(addr, mutt_b2s(keyid), mutt_b2s(keydata), 0)) + /* L10N: + Autocrypt has a setting "prefer-encrypt". + When the recommendation algorithm returns "available" and BOTH + sender and recipient choose "prefer-encrypt", encryption will be + automatically enabled. + Otherwise the UI will show encryption is "available" but the user + will be required to enable encryption manually. + */ + if (mutt_yesorno(_("Prefer encryption?"), MUTT_NO) == MUTT_YES) + prefer_encrypt = 1; + + if (mutt_autocrypt_db_account_insert(addr, mutt_b2s(keyid), mutt_b2s(keydata), prefer_encrypt)) goto cleanup; rc = 0;