mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-15 08:29:24 +00:00
Prevent enabling encryption when not available
This commit is contained in:
parent
7598ba4b7f
commit
4e7e299d85
1 changed files with 24 additions and 8 deletions
|
@ -1560,6 +1560,16 @@ public class FragmentCompose extends FragmentBase {
|
|||
draft.ui_encrypt = null;
|
||||
}
|
||||
|
||||
if (!PgpHelper.isOpenKeychainInstalled(context) &&
|
||||
(EntityMessage.PGP_SIGNONLY.equals(draft.ui_encrypt) ||
|
||||
EntityMessage.PGP_SIGNENCRYPT.equals(draft.ui_encrypt)))
|
||||
draft.ui_encrypt = null;
|
||||
|
||||
if (!ActivityBilling.isPro(context) &&
|
||||
(EntityMessage.SMIME_SIGNONLY.equals(draft.ui_encrypt) ||
|
||||
EntityMessage.SMIME_SIGNENCRYPT.equals(draft.ui_encrypt)))
|
||||
draft.ui_encrypt = null;
|
||||
|
||||
db.message().setMessageUiEncrypt(draft.id, draft.ui_encrypt);
|
||||
|
||||
db.message().setMessageSensitivity(draft.id, identity.sensitivity < 1 ? null : identity.sensitivity);
|
||||
|
@ -5670,15 +5680,21 @@ public class FragmentCompose extends FragmentBase {
|
|||
data.draft.plain_only = 1;
|
||||
|
||||
if (encrypt_default || selected.encrypt_default)
|
||||
if (selected.encrypt == 0)
|
||||
data.draft.ui_encrypt = EntityMessage.PGP_SIGNENCRYPT;
|
||||
else
|
||||
data.draft.ui_encrypt = EntityMessage.SMIME_SIGNENCRYPT;
|
||||
if (selected.encrypt == 0) {
|
||||
if (PgpHelper.isOpenKeychainInstalled(context))
|
||||
data.draft.ui_encrypt = EntityMessage.PGP_SIGNENCRYPT;
|
||||
} else {
|
||||
if (ActivityBilling.isPro(context))
|
||||
data.draft.ui_encrypt = EntityMessage.SMIME_SIGNENCRYPT;
|
||||
}
|
||||
else if (sign_default || selected.sign_default)
|
||||
if (selected.encrypt == 0)
|
||||
data.draft.ui_encrypt = EntityMessage.PGP_SIGNONLY;
|
||||
else
|
||||
data.draft.ui_encrypt = EntityMessage.SMIME_SIGNONLY;
|
||||
if (selected.encrypt == 0) {
|
||||
if (PgpHelper.isOpenKeychainInstalled(context))
|
||||
data.draft.ui_encrypt = EntityMessage.PGP_SIGNONLY;
|
||||
} else {
|
||||
if (ActivityBilling.isPro(context))
|
||||
data.draft.ui_encrypt = EntityMessage.SMIME_SIGNONLY;
|
||||
}
|
||||
}
|
||||
|
||||
if (receipt_default)
|
||||
|
|
Loading…
Add table
Reference in a new issue