Loading app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java +1 −1 Original line number Diff line number Diff line Loading @@ -722,7 +722,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, PgpMessageBuilder pgpBuilder = PgpMessageBuilder.newInstance(); recipientPresenter.builderSetProperties(pgpBuilder, cryptoStatus); builder = pgpBuilder; } else if (SendErrorState.PROVIDER_ERROR.equals(maybeSendErrorState) && cryptoStatus.getOpenPgpKeyId() == null) { // found provider error with no openPgpKey set up, means user doesn't actually configured encryption } else if (maybeSendErrorState.isIgnorableError(cryptoStatus.getOpenPgpKeyId())) { builder = SimpleMessageBuilder.newInstance(); recipientPresenter.builderSetProperties(builder); } else { Loading app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/ComposeCryptoStatus.kt +29 −1 Original line number Diff line number Diff line /* * Copyright ECORP SAS 2022 * * this program is free software: you can redistribute it and/or modify * it under the terms of the gnu general public license as published by * the free software foundation, either version 3 of the license, or * (at your option) any later version. * * this program is distributed in the hope that it will be useful, * but without any warranty; without even the implied warranty of * merchantability or fitness for a particular purpose. see the * gnu general public license for more details. * * you should have received a copy of the gnu general public license * along with this program. if not, see <https://www.gnu.org/licenses/>. */ package com.fsck.k9.activity.compose import com.fsck.k9.activity.compose.RecipientMvpView.CryptoSpecialModeDisplayType Loading Loading @@ -156,7 +173,18 @@ data class ComposeCryptoStatus( enum class SendErrorState { PROVIDER_ERROR, KEY_CONFIG_ERROR, ENABLED_ERROR ENABLED_ERROR; /** * We want to ignore encryptionSendError on message send operation for some specific conditions. * These conditions are: * * - found PROVIDER_ERROR error with no openPgpKey set up, means user doesn't actually configured encryption. * - on ENABLED_ERROR; it means encryption is enabled but not all recipient have key setup. */ fun isIgnorableError(openPgpKeyId: Long?) : Boolean { return ((equals(PROVIDER_ERROR) && openPgpKeyId == null) || equals(ENABLED_ERROR)) } } enum class AttachErrorState { Loading Loading
app/ui/legacy/src/main/java/com/fsck/k9/activity/MessageCompose.java +1 −1 Original line number Diff line number Diff line Loading @@ -722,7 +722,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, PgpMessageBuilder pgpBuilder = PgpMessageBuilder.newInstance(); recipientPresenter.builderSetProperties(pgpBuilder, cryptoStatus); builder = pgpBuilder; } else if (SendErrorState.PROVIDER_ERROR.equals(maybeSendErrorState) && cryptoStatus.getOpenPgpKeyId() == null) { // found provider error with no openPgpKey set up, means user doesn't actually configured encryption } else if (maybeSendErrorState.isIgnorableError(cryptoStatus.getOpenPgpKeyId())) { builder = SimpleMessageBuilder.newInstance(); recipientPresenter.builderSetProperties(builder); } else { Loading
app/ui/legacy/src/main/java/com/fsck/k9/activity/compose/ComposeCryptoStatus.kt +29 −1 Original line number Diff line number Diff line /* * Copyright ECORP SAS 2022 * * this program is free software: you can redistribute it and/or modify * it under the terms of the gnu general public license as published by * the free software foundation, either version 3 of the license, or * (at your option) any later version. * * this program is distributed in the hope that it will be useful, * but without any warranty; without even the implied warranty of * merchantability or fitness for a particular purpose. see the * gnu general public license for more details. * * you should have received a copy of the gnu general public license * along with this program. if not, see <https://www.gnu.org/licenses/>. */ package com.fsck.k9.activity.compose import com.fsck.k9.activity.compose.RecipientMvpView.CryptoSpecialModeDisplayType Loading Loading @@ -156,7 +173,18 @@ data class ComposeCryptoStatus( enum class SendErrorState { PROVIDER_ERROR, KEY_CONFIG_ERROR, ENABLED_ERROR ENABLED_ERROR; /** * We want to ignore encryptionSendError on message send operation for some specific conditions. * These conditions are: * * - found PROVIDER_ERROR error with no openPgpKey set up, means user doesn't actually configured encryption. * - on ENABLED_ERROR; it means encryption is enabled but not all recipient have key setup. */ fun isIgnorableError(openPgpKeyId: Long?) : Boolean { return ((equals(PROVIDER_ERROR) && openPgpKeyId == null) || equals(ENABLED_ERROR)) } } enum class AttachErrorState { Loading