diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 71e0ebbc0d..e9033707b5 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -5496,6 +5496,7 @@ public class FragmentCompose extends FragmentBase { boolean resize_reply = prefs.getBoolean("resize_reply", true); boolean sign_default = prefs.getBoolean("sign_default", false); boolean encrypt_default = prefs.getBoolean("encrypt_default", false); + boolean encrypt_reply = prefs.getBoolean("encrypt_reply", false); boolean receipt_default = prefs.getBoolean("receipt_default", false); boolean write_below = prefs.getBoolean("write_below", false); boolean perform_expunge = prefs.getBoolean("perform_expunge", true); @@ -5981,17 +5982,21 @@ public class FragmentCompose extends FragmentBase { // Encryption List
recipients = data.draft.getAllRecipients(); + boolean reply = (encrypt_reply && ( + EntityMessage.PGP_SIGNENCRYPT.equals(ref.ui_encrypt) || + EntityMessage.SMIME_SIGNENCRYPT.equals(ref.ui_encrypt))); + if (EntityMessage.PGP_SIGNONLY.equals(ref.ui_encrypt) || EntityMessage.PGP_SIGNENCRYPT.equals(ref.ui_encrypt)) { if (PgpHelper.isOpenKeychainInstalled(context) && selected.sign_key != null && - PgpHelper.hasPgpKey(context, recipients, true)) + (reply || PgpHelper.hasPgpKey(context, recipients, true))) data.draft.ui_encrypt = ref.ui_encrypt; } else if (EntityMessage.SMIME_SIGNONLY.equals(ref.ui_encrypt) || EntityMessage.SMIME_SIGNENCRYPT.equals(ref.ui_encrypt)) { if (ActivityBilling.isPro(context) && selected.sign_key_alias != null && - SmimeHelper.hasSmimeKey(context, recipients, true)) + (reply || SmimeHelper.hasSmimeKey(context, recipients, true))) data.draft.ui_encrypt = ref.ui_encrypt; } } diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsEncryption.java b/app/src/main/java/eu/faircode/email/FragmentOptionsEncryption.java index b7bde5ca2a..9a0d0053c0 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsEncryption.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsEncryption.java @@ -88,6 +88,7 @@ public class FragmentOptionsEncryption extends FragmentBase private SwitchCompat swSign; private SwitchCompat swEncrypt; private SwitchCompat swEncryptAuto; + private SwitchCompat swEncryptReply; private SwitchCompat swAutoVerify; private SwitchCompat swAutoDecrypt; private SwitchCompat swAutoUndoDecrypt; @@ -119,7 +120,7 @@ public class FragmentOptionsEncryption extends FragmentBase static final int REQUEST_IMPORT_CERTIFICATE = 1; final static List