Enable encryption if editing an encrypted draft
This commit is a hack. It assumes that if a draft is encrypted, the user chose to encrypt at some point and sets the status based on that assumption. This is only an assumption though, which becomes a problem e.g. if some other MUA encrypts all drafts. At some point we should remember the actual user choice.
This commit is contained in:
parent
f7fb48f53f
commit
47451c89fe
1 changed files with 8 additions and 0 deletions
|
@ -222,6 +222,7 @@ public class RecipientPresenter {
|
|||
|
||||
public void initFromDraftMessage(Message message) {
|
||||
initRecipientsFromDraftMessage(message);
|
||||
initEncryptionStatus(message);
|
||||
initPgpInlineFromDraftMessage(message);
|
||||
}
|
||||
|
||||
|
@ -235,6 +236,13 @@ public class RecipientPresenter {
|
|||
addBccAddresses(bccRecipients);
|
||||
}
|
||||
|
||||
private void initEncryptionStatus(Message message) {
|
||||
boolean isEncryptedDraft = composePgpEnableByDefaultDecider.shouldEncryptByDefault(message);
|
||||
if (isEncryptedDraft) {
|
||||
currentCryptoMode = CryptoMode.CHOICE_ENABLED;
|
||||
}
|
||||
}
|
||||
|
||||
private void initPgpInlineFromDraftMessage(Message message) {
|
||||
cryptoEnablePgpInline = message.isSet(Flag.X_DRAFT_OPENPGP_INLINE);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue