Loading app/core/src/main/java/com/fsck/k9/autocrypt/AutocryptDraftStateHeader.kt +5 −5 Original line number Diff line number Diff line Loading @@ -45,12 +45,12 @@ data class AutocryptDraftStateHeader(val isEncrypt: Boolean, const val VALUE_YES = "yes"; fun fromCryptoStatus(cryptoStatus: CryptoStatus): AutocryptDraftStateHeader { if (cryptoStatus.isSignOnly()) { return AutocryptDraftStateHeader(false, true, cryptoStatus.isReplyToEncrypted(), cryptoStatus.isUserChoice(), cryptoStatus.isPgpInlineModeEnabled(), mapOf()) if (cryptoStatus.isSignOnly) { return AutocryptDraftStateHeader(false, true, cryptoStatus.isReplyToEncrypted, cryptoStatus.isUserChoice(), cryptoStatus.isPgpInlineModeEnabled, mapOf()) } return AutocryptDraftStateHeader(cryptoStatus.isEncryptionEnabled(), false, cryptoStatus.isReplyToEncrypted(), cryptoStatus.isUserChoice(), cryptoStatus.isPgpInlineModeEnabled(), mapOf()) return AutocryptDraftStateHeader(cryptoStatus.isEncryptionEnabled, false, cryptoStatus.isReplyToEncrypted, cryptoStatus.isUserChoice(), cryptoStatus.isPgpInlineModeEnabled, mapOf()) } } } app/core/src/main/java/com/fsck/k9/message/CryptoStatus.kt +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ interface CryptoStatus { fun isUserChoice(): Boolean val isReplyToEncrypted: Boolean fun hasRecipients(): Boolean val isEncryptAllDrafts: Boolean val isEncryptSubject: Boolean fun getRecipientAddresses(): Array<String> } app/core/src/main/java/com/fsck/k9/message/PgpMessageBuilder.java +1 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,7 @@ public class PgpMessageBuilder extends MessageBuilder { private void startOrContinueBuildMessage(@Nullable Intent pgpApiIntent) { try { boolean shouldSign = cryptoStatus.isSigningEnabled() && !isDraft(); boolean shouldEncrypt = cryptoStatus.isEncryptionEnabled(); boolean shouldEncrypt = cryptoStatus.isEncryptionEnabled() || (isDraft() && cryptoStatus.isEncryptAllDrafts()); boolean isPgpInlineMode = cryptoStatus.isPgpInlineModeEnabled() && !isDraft(); if (!shouldSign && !shouldEncrypt) { Loading app/ui/src/main/java/com/fsck/k9/activity/compose/ComposeCryptoStatus.kt +8 −5 Original line number Diff line number Diff line Loading @@ -16,13 +16,14 @@ import org.openintents.openpgp.OpenPgpApiManager.OpenPgpProviderState * or saving as draft. */ data class ComposeCryptoStatus(private val openPgpProviderState: OpenPgpProviderState, private val cryptoMode: CryptoMode, override val openPgpKeyId: Long?, val recipientAddresses: List<String>, override val isPgpInlineModeEnabled: Boolean, override val isSenderPreferEncryptMutual: Boolean, override val isReplyToEncrypted: Boolean, override val isEncryptAllDrafts: Boolean, override val isEncryptSubject: Boolean, val recipientAddresses: List<String>, private val cryptoMode: CryptoMode, private val recipientAutocryptStatus: RecipientAutocryptStatus? = null) : CryptoStatus { constructor(openPgpProviderState: OpenPgpProviderState, Loading @@ -31,11 +32,12 @@ data class ComposeCryptoStatus(private val openPgpProviderState: OpenPgpProvider isPgpInlineModeEnabled: Boolean, isSenderPreferEncryptMutual: Boolean, isReplyToEncrypted: Boolean, isEncryptAllDrafts: Boolean, isEncryptSubject: Boolean, cryptoMode: CryptoMode) : this( openPgpProviderState, cryptoMode, openPgpKeyId, isPgpInlineModeEnabled, isSenderPreferEncryptMutual, isReplyToEncrypted, isEncryptSubject, recipientAddresses.map { it.address.address }) openPgpProviderState, openPgpKeyId, recipientAddresses.map { it.address.address }, isPgpInlineModeEnabled, isSenderPreferEncryptMutual, isReplyToEncrypted, isEncryptAllDrafts, isEncryptSubject, cryptoMode) private val recipientAutocryptStatusType = recipientAutocryptStatus?.type private val isRecipientsPreferEncryptMutual = recipientAutocryptStatus?.type?.isMutual ?: false Loading Loading @@ -141,6 +143,7 @@ data class ComposeCryptoStatus(private val openPgpProviderState: OpenPgpProvider isPgpInlineModeEnabled = isPgpInlineModeEnabled, isSenderPreferEncryptMutual = isSenderPreferEncryptMutual, isReplyToEncrypted = isReplyToEncrypted, isEncryptAllDrafts= isEncryptAllDrafts, isEncryptSubject = isEncryptSubject, recipientAddresses = recipientAddresses, recipientAutocryptStatus = recipientAutocryptStatusType Loading app/ui/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.java +1 −0 Original line number Diff line number Diff line Loading @@ -429,6 +429,7 @@ public class RecipientPresenter { cryptoEnablePgpInline, account.getAutocryptPreferEncryptMutual(), isReplyToEncryptedMessage, account.getOpenPgpEncryptAllDrafts(), account.getOpenPgpEncryptSubject(), currentCryptoMode); Loading Loading
app/core/src/main/java/com/fsck/k9/autocrypt/AutocryptDraftStateHeader.kt +5 −5 Original line number Diff line number Diff line Loading @@ -45,12 +45,12 @@ data class AutocryptDraftStateHeader(val isEncrypt: Boolean, const val VALUE_YES = "yes"; fun fromCryptoStatus(cryptoStatus: CryptoStatus): AutocryptDraftStateHeader { if (cryptoStatus.isSignOnly()) { return AutocryptDraftStateHeader(false, true, cryptoStatus.isReplyToEncrypted(), cryptoStatus.isUserChoice(), cryptoStatus.isPgpInlineModeEnabled(), mapOf()) if (cryptoStatus.isSignOnly) { return AutocryptDraftStateHeader(false, true, cryptoStatus.isReplyToEncrypted, cryptoStatus.isUserChoice(), cryptoStatus.isPgpInlineModeEnabled, mapOf()) } return AutocryptDraftStateHeader(cryptoStatus.isEncryptionEnabled(), false, cryptoStatus.isReplyToEncrypted(), cryptoStatus.isUserChoice(), cryptoStatus.isPgpInlineModeEnabled(), mapOf()) return AutocryptDraftStateHeader(cryptoStatus.isEncryptionEnabled, false, cryptoStatus.isReplyToEncrypted, cryptoStatus.isUserChoice(), cryptoStatus.isPgpInlineModeEnabled, mapOf()) } } }
app/core/src/main/java/com/fsck/k9/message/CryptoStatus.kt +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ interface CryptoStatus { fun isUserChoice(): Boolean val isReplyToEncrypted: Boolean fun hasRecipients(): Boolean val isEncryptAllDrafts: Boolean val isEncryptSubject: Boolean fun getRecipientAddresses(): Array<String> }
app/core/src/main/java/com/fsck/k9/message/PgpMessageBuilder.java +1 −1 Original line number Diff line number Diff line Loading @@ -145,7 +145,7 @@ public class PgpMessageBuilder extends MessageBuilder { private void startOrContinueBuildMessage(@Nullable Intent pgpApiIntent) { try { boolean shouldSign = cryptoStatus.isSigningEnabled() && !isDraft(); boolean shouldEncrypt = cryptoStatus.isEncryptionEnabled(); boolean shouldEncrypt = cryptoStatus.isEncryptionEnabled() || (isDraft() && cryptoStatus.isEncryptAllDrafts()); boolean isPgpInlineMode = cryptoStatus.isPgpInlineModeEnabled() && !isDraft(); if (!shouldSign && !shouldEncrypt) { Loading
app/ui/src/main/java/com/fsck/k9/activity/compose/ComposeCryptoStatus.kt +8 −5 Original line number Diff line number Diff line Loading @@ -16,13 +16,14 @@ import org.openintents.openpgp.OpenPgpApiManager.OpenPgpProviderState * or saving as draft. */ data class ComposeCryptoStatus(private val openPgpProviderState: OpenPgpProviderState, private val cryptoMode: CryptoMode, override val openPgpKeyId: Long?, val recipientAddresses: List<String>, override val isPgpInlineModeEnabled: Boolean, override val isSenderPreferEncryptMutual: Boolean, override val isReplyToEncrypted: Boolean, override val isEncryptAllDrafts: Boolean, override val isEncryptSubject: Boolean, val recipientAddresses: List<String>, private val cryptoMode: CryptoMode, private val recipientAutocryptStatus: RecipientAutocryptStatus? = null) : CryptoStatus { constructor(openPgpProviderState: OpenPgpProviderState, Loading @@ -31,11 +32,12 @@ data class ComposeCryptoStatus(private val openPgpProviderState: OpenPgpProvider isPgpInlineModeEnabled: Boolean, isSenderPreferEncryptMutual: Boolean, isReplyToEncrypted: Boolean, isEncryptAllDrafts: Boolean, isEncryptSubject: Boolean, cryptoMode: CryptoMode) : this( openPgpProviderState, cryptoMode, openPgpKeyId, isPgpInlineModeEnabled, isSenderPreferEncryptMutual, isReplyToEncrypted, isEncryptSubject, recipientAddresses.map { it.address.address }) openPgpProviderState, openPgpKeyId, recipientAddresses.map { it.address.address }, isPgpInlineModeEnabled, isSenderPreferEncryptMutual, isReplyToEncrypted, isEncryptAllDrafts, isEncryptSubject, cryptoMode) private val recipientAutocryptStatusType = recipientAutocryptStatus?.type private val isRecipientsPreferEncryptMutual = recipientAutocryptStatus?.type?.isMutual ?: false Loading Loading @@ -141,6 +143,7 @@ data class ComposeCryptoStatus(private val openPgpProviderState: OpenPgpProvider isPgpInlineModeEnabled = isPgpInlineModeEnabled, isSenderPreferEncryptMutual = isSenderPreferEncryptMutual, isReplyToEncrypted = isReplyToEncrypted, isEncryptAllDrafts= isEncryptAllDrafts, isEncryptSubject = isEncryptSubject, recipientAddresses = recipientAddresses, recipientAutocryptStatus = recipientAutocryptStatusType Loading
app/ui/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.java +1 −0 Original line number Diff line number Diff line Loading @@ -429,6 +429,7 @@ public class RecipientPresenter { cryptoEnablePgpInline, account.getAutocryptPreferEncryptMutual(), isReplyToEncryptedMessage, account.getOpenPgpEncryptAllDrafts(), account.getOpenPgpEncryptSubject(), currentCryptoMode); Loading