Add ImapStoreConfig.isExpungeImmediately()

This commit is contained in:
cketti 2024-03-15 16:23:36 +01:00
parent 2c2568dcf4
commit 3439662446
5 changed files with 7 additions and 0 deletions

View file

@ -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)
}
}

View file

@ -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)

View file

@ -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)

View file

@ -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
}

View file

@ -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")
}
}