diff --git a/app/common/src/main/java/com/fsck/k9/backends/ImapBackendFactory.kt b/app/common/src/main/java/com/fsck/k9/backends/ImapBackendFactory.kt index 62202b3bf..123ca4d22 100644 --- a/app/common/src/main/java/com/fsck/k9/backends/ImapBackendFactory.kt +++ b/app/common/src/main/java/com/fsck/k9/backends/ImapBackendFactory.kt @@ -2,6 +2,7 @@ package com.fsck.k9.backends import android.content.Context import com.fsck.k9.Account +import com.fsck.k9.Account.Expunge import com.fsck.k9.backend.BackendFactory import com.fsck.k9.backend.api.Backend import com.fsck.k9.backend.imap.ImapBackend @@ -74,6 +75,8 @@ class ImapBackendFactory( override fun isSubscribedFoldersOnly() = account.isSubscribedFoldersOnly + override fun isExpungeImmediately() = account.expungePolicy == Expunge.EXPUNGE_IMMEDIATELY + override fun clientId() = ImapClientId(appName = clientIdAppName, appVersion = clientIdAppVersion) } } diff --git a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapFolderFetcher.kt b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapFolderFetcher.kt index 11c32bd47..6479e0d38 100644 --- a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapFolderFetcher.kt +++ b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapFolderFetcher.kt @@ -41,6 +41,7 @@ class ImapFolderFetcher internal constructor( val config = object : ImapStoreConfig { override val logLabel = "folder-fetcher" override fun isSubscribedFoldersOnly() = false + override fun isExpungeImmediately() = false override fun clientId() = ImapClientId(appName = clientIdAppName, appVersion = clientIdAppVersion) } val oAuth2TokenProvider = createOAuth2TokenProviderOrNull(authStateStorage) diff --git a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapServerSettingsValidator.kt b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapServerSettingsValidator.kt index 2c71b3d48..82cb34bae 100644 --- a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapServerSettingsValidator.kt +++ b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapServerSettingsValidator.kt @@ -32,6 +32,7 @@ class ImapServerSettingsValidator( val config = object : ImapStoreConfig { override val logLabel = "check" override fun isSubscribedFoldersOnly() = false + override fun isExpungeImmediately() = false override fun clientId() = ImapClientId(appName = clientIdAppName, appVersion = clientIdAppVersion) } val oAuth2TokenProvider = createOAuth2TokenProviderOrNull(authStateStorage) diff --git a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapStoreConfig.kt b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapStoreConfig.kt index e767f16aa..989899e4c 100644 --- a/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapStoreConfig.kt +++ b/mail/protocols/imap/src/main/java/com/fsck/k9/mail/store/imap/ImapStoreConfig.kt @@ -3,5 +3,6 @@ package com.fsck.k9.mail.store.imap interface ImapStoreConfig { val logLabel: String fun isSubscribedFoldersOnly(): Boolean + fun isExpungeImmediately(): Boolean fun clientId(): ImapClientId } diff --git a/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/RealImapStoreTest.kt b/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/RealImapStoreTest.kt index 5bd444635..42485bc9a 100644 --- a/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/RealImapStoreTest.kt +++ b/mail/protocols/imap/src/test/java/com/fsck/k9/mail/store/imap/RealImapStoreTest.kt @@ -408,6 +408,7 @@ class RealImapStoreTest { return object : ImapStoreConfig { override val logLabel: String = "irrelevant" override fun isSubscribedFoldersOnly(): Boolean = isSubscribedFoldersOnly + override fun isExpungeImmediately(): Boolean = true override fun clientId(): ImapClientId = ImapClientId(appName = "irrelevant", appVersion = "irrelevant") } }