Loading app-common/build.gradle.kts +4 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,10 @@ dependencies { implementation(projects.legacy.account) implementation(projects.core.featureflags) implementation(projects.core.ui.legacy.theme2.common) implementation(projects.feature.account.setup) implementation(projects.feature.migration.provider) implementation(projects.mail.protocols.imap) } app-common/src/main/kotlin/net/thunderbird/app/common/AppCommonModule.kt +2 −27 Original line number Diff line number Diff line package net.thunderbird.app.common import app.k9mail.legacy.account.AccountDefaultsProvider import app.k9mail.legacy.account.LegacyAccountWrapperManager import net.thunderbird.app.common.account.CommonAccountDefaultsProvider import net.thunderbird.app.common.account.data.CommonAccountProfileLocalDataSource import net.thunderbird.app.common.account.data.CommonLegacyAccountWrapperManager import net.thunderbird.feature.account.core.AccountCoreExternalContract.AccountProfileLocalDataSource import net.thunderbird.feature.account.core.featureAccountCoreModule import net.thunderbird.app.common.account.appCommonAccountModule import org.koin.core.module.Module import org.koin.dsl.module val appCommonModule: Module = module { includes( featureAccountCoreModule, appCommonAccountModule, ) single<LegacyAccountWrapperManager> { CommonLegacyAccountWrapperManager( accountManager = get(), ) } single<AccountProfileLocalDataSource> { CommonAccountProfileLocalDataSource( accountManager = get(), ) } single<AccountDefaultsProvider> { CommonAccountDefaultsProvider( resourceProvider = get(), featureFlagProvider = get(), ) } } legacy/common/src/main/java/com/fsck/k9/account/AccountColorPicker.kt→app-common/src/main/kotlin/net/thunderbird/app/common/account/AccountColorPicker.kt +2 −2 Original line number Diff line number Diff line package com.fsck.k9.account package net.thunderbird.app.common.account import android.content.res.Resources import app.k9mail.core.ui.legacy.theme2.common.R import app.k9mail.legacy.account.AccountManager import com.fsck.k9.core.R class AccountColorPicker( private val accountManager: AccountManager, Loading legacy/common/src/main/java/com/fsck/k9/account/AccountCreator.kt→app-common/src/main/kotlin/net/thunderbird/app/common/account/AccountCreator.kt +6 −6 Original line number Diff line number Diff line package com.fsck.k9.account package net.thunderbird.app.common.account import android.content.Context import app.k9mail.core.common.mail.Protocols Loading @@ -7,9 +7,11 @@ import app.k9mail.feature.account.common.domain.entity.SpecialFolderOption import app.k9mail.feature.account.common.domain.entity.SpecialFolderSettings import app.k9mail.feature.account.setup.AccountSetupExternalContract import app.k9mail.feature.account.setup.AccountSetupExternalContract.AccountCreator.AccountCreatorResult import app.k9mail.legacy.account.LegacyAccount import app.k9mail.legacy.account.SpecialFolderSelection import com.fsck.k9.Core import com.fsck.k9.Preferences import com.fsck.k9.account.DeletePolicyProvider import com.fsck.k9.controller.MessagingController import com.fsck.k9.logging.Timber import com.fsck.k9.mail.ServerSettings Loading @@ -18,13 +20,11 @@ import com.fsck.k9.mail.store.imap.ImapStoreSettings.createExtra import com.fsck.k9.mail.store.imap.ImapStoreSettings.isSendClientInfo import com.fsck.k9.mail.store.imap.ImapStoreSettings.isUseCompression import com.fsck.k9.mail.store.imap.ImapStoreSettings.pathPrefix import com.fsck.k9.mailstore.SpecialFolderUpdater import com.fsck.k9.mailstore.SpecialLocalFoldersCreator import com.fsck.k9.preferences.UnifiedInboxConfigurator import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import app.k9mail.legacy.account.LegacyAccount as K9Account // TODO Move to feature/account/setup class AccountCreator( Loading Loading @@ -99,9 +99,9 @@ class AccountCreator( * Set special folders by name. * * Since the folder list hasn't been synced yet, we don't have database IDs for the folders. So we use the same * mechanism that is used when importing settings. See [SpecialFolderUpdater] for details. * mechanism that is used when importing settings. See [com.fsck.k9.mailstore.SpecialFolderUpdater] for details. */ private fun K9Account.setSpecialFolders(specialFolders: SpecialFolderSettings) { private fun LegacyAccount.setSpecialFolders(specialFolders: SpecialFolderSettings) { importedArchiveFolder = specialFolders.archiveSpecialFolderOption.toFolderServerId() archiveFolderSelection = specialFolders.archiveSpecialFolderOption.toFolderSelection() Loading Loading @@ -141,7 +141,7 @@ class AccountCreator( } } private fun K9Account.setIncomingServerSettings(serverSettings: ServerSettings) { private fun LegacyAccount.setIncomingServerSettings(serverSettings: ServerSettings) { if (serverSettings.type == Protocols.IMAP) { useCompression = serverSettings.isUseCompression isSendClientInfoEnabled = serverSettings.isSendClientInfo Loading app-common/src/main/kotlin/net/thunderbird/app/common/account/AppCommonAccountModule.kt 0 → 100644 +55 −0 Original line number Diff line number Diff line package net.thunderbird.app.common.account import app.k9mail.feature.account.setup.AccountSetupExternalContract import app.k9mail.legacy.account.AccountDefaultsProvider import app.k9mail.legacy.account.LegacyAccountWrapperManager import net.thunderbird.app.common.account.data.CommonAccountProfileLocalDataSource import net.thunderbird.app.common.account.data.CommonLegacyAccountWrapperManager import net.thunderbird.feature.account.core.AccountCoreExternalContract.AccountProfileLocalDataSource import net.thunderbird.feature.account.core.featureAccountCoreModule import org.koin.android.ext.koin.androidApplication import org.koin.dsl.module internal val appCommonAccountModule = module { includes( featureAccountCoreModule, ) single<LegacyAccountWrapperManager> { CommonLegacyAccountWrapperManager( accountManager = get(), ) } single<AccountProfileLocalDataSource> { CommonAccountProfileLocalDataSource( accountManager = get(), ) } single<AccountDefaultsProvider> { CommonAccountDefaultsProvider( resourceProvider = get(), featureFlagProvider = get(), ) } factory { AccountColorPicker( accountManager = get(), resources = get(), ) } factory<AccountSetupExternalContract.AccountCreator> { AccountCreator( accountColorPicker = get(), localFoldersCreator = get(), preferences = get(), context = androidApplication(), deletePolicyProvider = get(), messagingController = get(), unifiedInboxConfigurator = get(), ) } } Loading
app-common/build.gradle.kts +4 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,10 @@ dependencies { implementation(projects.legacy.account) implementation(projects.core.featureflags) implementation(projects.core.ui.legacy.theme2.common) implementation(projects.feature.account.setup) implementation(projects.feature.migration.provider) implementation(projects.mail.protocols.imap) }
app-common/src/main/kotlin/net/thunderbird/app/common/AppCommonModule.kt +2 −27 Original line number Diff line number Diff line package net.thunderbird.app.common import app.k9mail.legacy.account.AccountDefaultsProvider import app.k9mail.legacy.account.LegacyAccountWrapperManager import net.thunderbird.app.common.account.CommonAccountDefaultsProvider import net.thunderbird.app.common.account.data.CommonAccountProfileLocalDataSource import net.thunderbird.app.common.account.data.CommonLegacyAccountWrapperManager import net.thunderbird.feature.account.core.AccountCoreExternalContract.AccountProfileLocalDataSource import net.thunderbird.feature.account.core.featureAccountCoreModule import net.thunderbird.app.common.account.appCommonAccountModule import org.koin.core.module.Module import org.koin.dsl.module val appCommonModule: Module = module { includes( featureAccountCoreModule, appCommonAccountModule, ) single<LegacyAccountWrapperManager> { CommonLegacyAccountWrapperManager( accountManager = get(), ) } single<AccountProfileLocalDataSource> { CommonAccountProfileLocalDataSource( accountManager = get(), ) } single<AccountDefaultsProvider> { CommonAccountDefaultsProvider( resourceProvider = get(), featureFlagProvider = get(), ) } }
legacy/common/src/main/java/com/fsck/k9/account/AccountColorPicker.kt→app-common/src/main/kotlin/net/thunderbird/app/common/account/AccountColorPicker.kt +2 −2 Original line number Diff line number Diff line package com.fsck.k9.account package net.thunderbird.app.common.account import android.content.res.Resources import app.k9mail.core.ui.legacy.theme2.common.R import app.k9mail.legacy.account.AccountManager import com.fsck.k9.core.R class AccountColorPicker( private val accountManager: AccountManager, Loading
legacy/common/src/main/java/com/fsck/k9/account/AccountCreator.kt→app-common/src/main/kotlin/net/thunderbird/app/common/account/AccountCreator.kt +6 −6 Original line number Diff line number Diff line package com.fsck.k9.account package net.thunderbird.app.common.account import android.content.Context import app.k9mail.core.common.mail.Protocols Loading @@ -7,9 +7,11 @@ import app.k9mail.feature.account.common.domain.entity.SpecialFolderOption import app.k9mail.feature.account.common.domain.entity.SpecialFolderSettings import app.k9mail.feature.account.setup.AccountSetupExternalContract import app.k9mail.feature.account.setup.AccountSetupExternalContract.AccountCreator.AccountCreatorResult import app.k9mail.legacy.account.LegacyAccount import app.k9mail.legacy.account.SpecialFolderSelection import com.fsck.k9.Core import com.fsck.k9.Preferences import com.fsck.k9.account.DeletePolicyProvider import com.fsck.k9.controller.MessagingController import com.fsck.k9.logging.Timber import com.fsck.k9.mail.ServerSettings Loading @@ -18,13 +20,11 @@ import com.fsck.k9.mail.store.imap.ImapStoreSettings.createExtra import com.fsck.k9.mail.store.imap.ImapStoreSettings.isSendClientInfo import com.fsck.k9.mail.store.imap.ImapStoreSettings.isUseCompression import com.fsck.k9.mail.store.imap.ImapStoreSettings.pathPrefix import com.fsck.k9.mailstore.SpecialFolderUpdater import com.fsck.k9.mailstore.SpecialLocalFoldersCreator import com.fsck.k9.preferences.UnifiedInboxConfigurator import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import app.k9mail.legacy.account.LegacyAccount as K9Account // TODO Move to feature/account/setup class AccountCreator( Loading Loading @@ -99,9 +99,9 @@ class AccountCreator( * Set special folders by name. * * Since the folder list hasn't been synced yet, we don't have database IDs for the folders. So we use the same * mechanism that is used when importing settings. See [SpecialFolderUpdater] for details. * mechanism that is used when importing settings. See [com.fsck.k9.mailstore.SpecialFolderUpdater] for details. */ private fun K9Account.setSpecialFolders(specialFolders: SpecialFolderSettings) { private fun LegacyAccount.setSpecialFolders(specialFolders: SpecialFolderSettings) { importedArchiveFolder = specialFolders.archiveSpecialFolderOption.toFolderServerId() archiveFolderSelection = specialFolders.archiveSpecialFolderOption.toFolderSelection() Loading Loading @@ -141,7 +141,7 @@ class AccountCreator( } } private fun K9Account.setIncomingServerSettings(serverSettings: ServerSettings) { private fun LegacyAccount.setIncomingServerSettings(serverSettings: ServerSettings) { if (serverSettings.type == Protocols.IMAP) { useCompression = serverSettings.isUseCompression isSendClientInfoEnabled = serverSettings.isSendClientInfo Loading
app-common/src/main/kotlin/net/thunderbird/app/common/account/AppCommonAccountModule.kt 0 → 100644 +55 −0 Original line number Diff line number Diff line package net.thunderbird.app.common.account import app.k9mail.feature.account.setup.AccountSetupExternalContract import app.k9mail.legacy.account.AccountDefaultsProvider import app.k9mail.legacy.account.LegacyAccountWrapperManager import net.thunderbird.app.common.account.data.CommonAccountProfileLocalDataSource import net.thunderbird.app.common.account.data.CommonLegacyAccountWrapperManager import net.thunderbird.feature.account.core.AccountCoreExternalContract.AccountProfileLocalDataSource import net.thunderbird.feature.account.core.featureAccountCoreModule import org.koin.android.ext.koin.androidApplication import org.koin.dsl.module internal val appCommonAccountModule = module { includes( featureAccountCoreModule, ) single<LegacyAccountWrapperManager> { CommonLegacyAccountWrapperManager( accountManager = get(), ) } single<AccountProfileLocalDataSource> { CommonAccountProfileLocalDataSource( accountManager = get(), ) } single<AccountDefaultsProvider> { CommonAccountDefaultsProvider( resourceProvider = get(), featureFlagProvider = get(), ) } factory { AccountColorPicker( accountManager = get(), resources = get(), ) } factory<AccountSetupExternalContract.AccountCreator> { AccountCreator( accountColorPicker = get(), localFoldersCreator = get(), preferences = get(), context = androidApplication(), deletePolicyProvider = get(), messagingController = get(), unifiedInboxConfigurator = get(), ) } }