From 7fff3c7c0e3b76547c554eefe9a160f5fbca39ed Mon Sep 17 00:00:00 2001 From: yamilmedina Date: Thu, 12 Oct 2023 15:59:39 +0200 Subject: [PATCH 1/9] chore: introduce architecture fitness functions --- gradle/libs.versions.toml | 2 ++ logic/build.gradle.kts | 1 + .../architecture/LayerAccessRulesTest.kt | 36 +++++++++++++++++++ .../logic/architecture/PackagingRulesTest.kt | 34 ++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/LayerAccessRulesTest.kt create mode 100644 logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/PackagingRulesTest.kt diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 355b2291050..2cc965bc2e6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -55,6 +55,7 @@ faker = "1.14.0" robolectric = "4.9" stately = "2.0.0-rc3" micrometer = "1.11.3" +konsist = "0.13.0" [plugins] # Home-made convention plugins @@ -166,6 +167,7 @@ mockative-runtime = { module = "io.mockative:mockative", version.ref = "mockativ mockative-processor = { module = "io.mockative:mockative-processor", version.ref = "mockative" } turbine = { module = "app.cash.turbine:turbine", version.ref = "turbine" } mockk = { module = "io.mockk:mockk", version.ref = "mockk" } +konsist = { module = "com.lemonappdev:konsist", version.ref = "konsist" } # detekt detekt-cli = { module = "io.gitlab.arturbosch.detekt:detekt-cli", version.ref = "detekt" } diff --git a/logic/build.gradle.kts b/logic/build.gradle.kts index eb435d41d15..eb3957bd1c0 100644 --- a/logic/build.gradle.kts +++ b/logic/build.gradle.kts @@ -78,6 +78,7 @@ kotlin { implementation(libs.mockative.runtime) implementation(libs.okio.test) implementation(libs.settings.kmpTest) + implementation(libs.konsist) } } diff --git a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/LayerAccessRulesTest.kt b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/LayerAccessRulesTest.kt new file mode 100644 index 00000000000..40859e92ce2 --- /dev/null +++ b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/LayerAccessRulesTest.kt @@ -0,0 +1,36 @@ +/* + * Wire + * Copyright (C) 2023 Wire Swiss GmbH + * + * 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 http://www.gnu.org/licenses/. + */ +package com.wire.kalium.logic.architecture + +import com.lemonappdev.konsist.api.Konsist +import com.lemonappdev.konsist.api.ext.list.withNameEndingWith +import com.lemonappdev.konsist.api.verify.assertTrue +import kotlin.test.Test + +class LayerAccessRulesTest { + + @Test + fun useCaseImplementationsShouldBeInternal() { + Konsist.scopeFromProject() + .classes() + .withNameEndingWith("UseCaseImpl") + .assertTrue { useCase -> + useCase.constructors.all { it.hasInternalModifier } || useCase.hasInternalModifier + } + } +} diff --git a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/PackagingRulesTest.kt b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/PackagingRulesTest.kt new file mode 100644 index 00000000000..3e4b605d1a2 --- /dev/null +++ b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/PackagingRulesTest.kt @@ -0,0 +1,34 @@ +/* + * Wire + * Copyright (C) 2023 Wire Swiss GmbH + * + * 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 http://www.gnu.org/licenses/. + */ +package com.wire.kalium.logic.architecture + +import com.lemonappdev.konsist.api.Konsist +import com.lemonappdev.konsist.api.ext.list.withNameEndingWith +import com.lemonappdev.konsist.api.verify.assertTrue +import kotlin.test.Test + +class PackagingRulesTest { + + @Test + fun classesWithUseCaseSuffixShouldResideInFeaturePackage() { + Konsist.scopeFromProject() + .classes() + .withNameEndingWith("UseCase") + .assertTrue { it.resideInPackage("..feature..") || it.resideInPackage("..sync..") } + } +} From 57f2390d6feaf8825e376f6a171af0d324e677ad Mon Sep 17 00:00:00 2001 From: yamilmedina Date: Thu, 12 Oct 2023 16:48:37 +0200 Subject: [PATCH 2/9] chore: introduce architecture fitness functions --- .../client/ClientFingerprintUseCase.kt | 40 +++++----- .../logic/feature/client/ClientScope.kt | 2 +- .../message/MarkMessagesAsNotifiedUseCase.kt | 11 +-- .../logic/sync/SetConnectionPolicyUseCase.kt | 1 + .../client/ClientFingerprintUseCaseTest.kt | 8 +- .../architecture/LayerAccessRulesTest.kt | 42 ++++++++-- .../logic/architecture/PackagingRulesTest.kt | 34 -------- .../logic/architecture/UseCaseRulesTest.kt | 79 +++++++++++++++++++ 8 files changed, 147 insertions(+), 70 deletions(-) delete mode 100644 logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/PackagingRulesTest.kt create mode 100644 logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/UseCaseRulesTest.kt diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCase.kt index 492caad76b2..6b6e12b8eac 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCase.kt @@ -37,15 +37,19 @@ import com.wire.kalium.logic.wrapProteusRequest * If no session exists for the client, a new session is established. * @param userId The user id of the client. * @param clientId The client id of the client. - * @return [ClientFingerprintUseCase.Result.Success] if the fingerprint was retrieved successfully. - * [ClientFingerprintUseCase.Result.Failure] if the fingerprint could not be retrieved. + * @return [Result.Success] if the fingerprint was retrieved successfully. + * [Result.Failure] if the fingerprint could not be retrieved. */ +interface ClientFingerprintUseCase { + suspend operator fun invoke(userId: UserId, clientId: ClientId): Result +} + -class ClientFingerprintUseCase internal constructor( +class ClientFingerprintUseCaseImpl internal constructor( private val proteusClientProvider: ProteusClientProvider, private val prekeyRepository: PreKeyRepository -) { - suspend operator fun invoke(userId: UserId, clientId: ClientId): Result = +) : ClientFingerprintUseCase { + override suspend operator fun invoke(userId: UserId, clientId: ClientId): Result = proteusClientProvider.getOrError().flatMap { proteusClient -> wrapProteusRequest { proteusClient.remoteFingerPrint(CryptoSessionId(userId.toCrypto(), CryptoClientId(clientId.value))) @@ -78,23 +82,23 @@ class ClientFingerprintUseCase internal constructor( } ) } +} - sealed interface Result { - data class Success(val fingerprint: ByteArray) : Result { - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (other == null || this::class != other::class) return false - - other as Success +sealed interface Result { + data class Success(val fingerprint: ByteArray) : Result { + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other == null || this::class != other::class) return false - return fingerprint.contentEquals(other.fingerprint) - } + other as Success - override fun hashCode(): Int { - return fingerprint.contentHashCode() - } + return fingerprint.contentEquals(other.fingerprint) } - data class Failure(val error: CoreFailure) : Result + override fun hashCode(): Int { + return fingerprint.contentHashCode() + } } + + data class Failure(val error: CoreFailure) : Result } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientScope.kt index f7af6ae4941..e38d8c45ad8 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientScope.kt @@ -140,7 +140,7 @@ class ClientScope @OptIn(DelicateKaliumApi::class) internal constructor( cachedClientIdClearer ) - val remoteClientFingerPrint: ClientFingerprintUseCase get() = ClientFingerprintUseCase(proteusClientProvider, preKeyRepository) + val remoteClientFingerPrint: ClientFingerprintUseCase get() = ClientFingerprintUseCaseImpl(proteusClientProvider, preKeyRepository) val updateClientVerificationStatus: UpdateClientVerificationStatusUseCase get() = UpdateClientVerificationStatusUseCase(clientRepository) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MarkMessagesAsNotifiedUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MarkMessagesAsNotifiedUseCase.kt index 37cd67999ae..3615495bf45 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MarkMessagesAsNotifiedUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MarkMessagesAsNotifiedUseCase.kt @@ -27,6 +27,7 @@ import com.wire.kalium.logic.functional.fold * Marks conversations in one or all conversations as notified, so the notifications for these messages won't show up again. * @see GetNotificationsUseCase */ +@Suppress("konsist.classesWithUseCaseSuffixShouldHaveSinglePublicOperatorFunctionCalledInvoke") class MarkMessagesAsNotifiedUseCase internal constructor( private val conversationRepository: ConversationRepository ) { @@ -46,12 +47,12 @@ class MarkMessagesAsNotifiedUseCase internal constructor( * @param conversationsToUpdate which conversation(s) to be marked as notified. */ suspend operator fun invoke(conversationsToUpdate: UpdateTarget): Result = - when (conversationsToUpdate) { - UpdateTarget.AllConversations -> conversationRepository.updateAllConversationsNotificationDate() + when (conversationsToUpdate) { + UpdateTarget.AllConversations -> conversationRepository.updateAllConversationsNotificationDate() - is UpdateTarget.SingleConversation -> - conversationRepository.updateConversationNotificationDate(conversationsToUpdate.conversationId) - }.fold({ Result.Failure(it) }) { Result.Success } + is UpdateTarget.SingleConversation -> + conversationRepository.updateConversationNotificationDate(conversationsToUpdate.conversationId) + }.fold({ Result.Failure(it) }) { Result.Success } /** * Specifies which conversations should be marked as notified diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/SetConnectionPolicyUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/SetConnectionPolicyUseCase.kt index c7f5f311430..5144067523f 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/SetConnectionPolicyUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/SetConnectionPolicyUseCase.kt @@ -21,6 +21,7 @@ package com.wire.kalium.logic.sync import com.wire.kalium.logic.data.sync.ConnectionPolicy import com.wire.kalium.logic.data.sync.IncrementalSyncRepository +@Suppress("konsist.classesWithUseCaseSuffixShouldResideInFeaturePackage") class SetConnectionPolicyUseCase internal constructor( private val incrementalSyncRepository: IncrementalSyncRepository, ) { diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCaseTest.kt index 8e987978e3d..49230fb0bcf 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCaseTest.kt @@ -56,7 +56,7 @@ class ClientFingerprintUseCaseTest { .arrange() userCase(userId, clientId).also { result -> - assertIs(result) + assertIs(result) assertEquals(fingerprint, result.fingerprint) } @@ -84,7 +84,7 @@ class ClientFingerprintUseCaseTest { .arrange() userCase(userId, clientId).also { result -> - assertIs(result) + assertIs(result) assertEquals(fingerprint, result.fingerprint) } @@ -112,7 +112,7 @@ class ClientFingerprintUseCaseTest { .arrange() userCase(userId, clientId).also { result -> - assertIs(result) + assertIs(result) assertIs(result.error) assertEquals(error.code, (result.error as ProteusFailure).proteusException.code) } @@ -140,7 +140,7 @@ class ClientFingerprintUseCaseTest { @Mock val proteusClient = mock(ProteusClient::class) - val userCase = ClientFingerprintUseCase( + val userCase = ClientFingerprintUseCaseImpl( proteusClientProvider = proteusClientProvider, prekeyRepository = preKeyRepository ) diff --git a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/LayerAccessRulesTest.kt b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/LayerAccessRulesTest.kt index 40859e92ce2..d4f58faa17b 100644 --- a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/LayerAccessRulesTest.kt +++ b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/LayerAccessRulesTest.kt @@ -18,19 +18,45 @@ package com.wire.kalium.logic.architecture import com.lemonappdev.konsist.api.Konsist -import com.lemonappdev.konsist.api.ext.list.withNameEndingWith -import com.lemonappdev.konsist.api.verify.assertTrue +import com.lemonappdev.konsist.api.ext.list.withPackage +import com.lemonappdev.konsist.api.verify.assertFalse import kotlin.test.Test class LayerAccessRulesTest { @Test - fun useCaseImplementationsShouldBeInternal() { - Konsist.scopeFromProject() - .classes() - .withNameEndingWith("UseCaseImpl") - .assertTrue { useCase -> - useCase.constructors.all { it.hasInternalModifier } || useCase.hasInternalModifier + fun repositoriesShouldNotAccessFeaturePackageClasses() { + Konsist.scopeFromProduction() + .files + .withPackage("com.wire.kalium.logic.data..") + .assertFalse { + it.hasImport { + it.hasNameContaining("feature") + } + } + } + + @Test + fun useCasesShouldNotAccessDaoLayerDirectly() { + Konsist.scopeFromProduction() + .files + .withPackage("com.wire.kalium.logic.feature..") + .assertFalse { + it.hasImport { + it.hasNameContaining("persistence") + } + } + } + + @Test + fun useCasesShouldNotAccessNetworkLayerDirectly() { + Konsist.scopeFromProduction() + .files + .withPackage("com.wire.kalium.logic.feature..") + .assertFalse { + it.hasImport { + it.hasNameContaining("network") && !it.hasNameContaining("exception") + } } } } diff --git a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/PackagingRulesTest.kt b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/PackagingRulesTest.kt deleted file mode 100644 index 3e4b605d1a2..00000000000 --- a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/PackagingRulesTest.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Wire - * Copyright (C) 2023 Wire Swiss GmbH - * - * 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 http://www.gnu.org/licenses/. - */ -package com.wire.kalium.logic.architecture - -import com.lemonappdev.konsist.api.Konsist -import com.lemonappdev.konsist.api.ext.list.withNameEndingWith -import com.lemonappdev.konsist.api.verify.assertTrue -import kotlin.test.Test - -class PackagingRulesTest { - - @Test - fun classesWithUseCaseSuffixShouldResideInFeaturePackage() { - Konsist.scopeFromProject() - .classes() - .withNameEndingWith("UseCase") - .assertTrue { it.resideInPackage("..feature..") || it.resideInPackage("..sync..") } - } -} diff --git a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/UseCaseRulesTest.kt b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/UseCaseRulesTest.kt new file mode 100644 index 00000000000..149dec85f5f --- /dev/null +++ b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/UseCaseRulesTest.kt @@ -0,0 +1,79 @@ +/* + * Wire + * Copyright (C) 2023 Wire Swiss GmbH + * + * 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 http://www.gnu.org/licenses/. + */ +package com.wire.kalium.logic.architecture + +import com.lemonappdev.konsist.api.Konsist +import com.lemonappdev.konsist.api.ext.list.withNameEndingWith +import com.lemonappdev.konsist.api.ext.list.withParentNamed +import com.lemonappdev.konsist.api.verify.assertTrue +import kotlin.test.Ignore +import kotlin.test.Test + +class UseCaseRulesTest { + + @Test + fun classesWithUseCaseSuffixShouldResideInFeaturePackage() { + Konsist.scopeFromProject() + .classes() + .withNameEndingWith("UseCase") + .assertTrue { it.resideInPackage("..feature..") } + } + + @Test + fun classesWithUseCaseSuffixShouldHaveSinglePublicOperatorFunctionCalledInvoke() { + Konsist + .scopeFromProject() + .classes() + .withNameEndingWith("UseCase") + .assertTrue { + val hasSingleInvokeOperatorMethod = it.hasFunction { function -> + function.name == "invoke" && function.hasPublicOrDefaultModifier && function.hasOperatorModifier + } + + hasSingleInvokeOperatorMethod && it.countFunctions { item -> item.hasPublicOrDefaultModifier } == 1 + } + } + + @Test + fun everyUseCaseClassHasTests() { + Konsist + .scopeFromProject() + .classes() + .withParentNamed("UseCase") + .assertTrue { it.hasTestClass() } + } + + @Test + fun everyUseCaseClassHasKDocs() { + Konsist + .scopeFromProject() + .classes() + .withParentNamed("UseCase") + .assertTrue { it.hasKDoc } + } + + @Test + fun useCaseImplementationsShouldBeInternalOrHaveInternalConstructor() { + Konsist.scopeFromProject() + .classes() + .withNameEndingWith("UseCaseImpl") + .assertTrue { useCase -> + useCase.hasAllConstructors { it.hasInternalModifier } || useCase.hasInternalModifier + } + } +} From 7a3d698ec89504bf1e62c1ff31e57a0ba6913b92 Mon Sep 17 00:00:00 2001 From: yamilmedina Date: Thu, 12 Oct 2023 16:51:04 +0200 Subject: [PATCH 3/9] chore: introduce architecture fitness functions --- .../kalium/logic/architecture/UseCaseRulesTest.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/UseCaseRulesTest.kt b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/UseCaseRulesTest.kt index 149dec85f5f..38e1f4bf3ce 100644 --- a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/UseCaseRulesTest.kt +++ b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/UseCaseRulesTest.kt @@ -21,14 +21,13 @@ import com.lemonappdev.konsist.api.Konsist import com.lemonappdev.konsist.api.ext.list.withNameEndingWith import com.lemonappdev.konsist.api.ext.list.withParentNamed import com.lemonappdev.konsist.api.verify.assertTrue -import kotlin.test.Ignore import kotlin.test.Test class UseCaseRulesTest { @Test fun classesWithUseCaseSuffixShouldResideInFeaturePackage() { - Konsist.scopeFromProject() + Konsist.scopeFromProduction() .classes() .withNameEndingWith("UseCase") .assertTrue { it.resideInPackage("..feature..") } @@ -37,7 +36,7 @@ class UseCaseRulesTest { @Test fun classesWithUseCaseSuffixShouldHaveSinglePublicOperatorFunctionCalledInvoke() { Konsist - .scopeFromProject() + .scopeFromProduction() .classes() .withNameEndingWith("UseCase") .assertTrue { @@ -52,7 +51,7 @@ class UseCaseRulesTest { @Test fun everyUseCaseClassHasTests() { Konsist - .scopeFromProject() + .scopeFromProduction() .classes() .withParentNamed("UseCase") .assertTrue { it.hasTestClass() } @@ -61,7 +60,7 @@ class UseCaseRulesTest { @Test fun everyUseCaseClassHasKDocs() { Konsist - .scopeFromProject() + .scopeFromProduction() .classes() .withParentNamed("UseCase") .assertTrue { it.hasKDoc } @@ -69,7 +68,7 @@ class UseCaseRulesTest { @Test fun useCaseImplementationsShouldBeInternalOrHaveInternalConstructor() { - Konsist.scopeFromProject() + Konsist.scopeFromProduction() .classes() .withNameEndingWith("UseCaseImpl") .assertTrue { useCase -> From 9185b6cc7300e58f8a1ac5407a3f6f2e41cef322 Mon Sep 17 00:00:00 2001 From: yamilmedina Date: Thu, 12 Oct 2023 17:03:00 +0200 Subject: [PATCH 4/9] chore: introduce architecture fitness functions --- .../wire/kalium/logic/feature/client/ClientFingerprintUseCase.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCase.kt index 6b6e12b8eac..3cae85e397a 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCase.kt @@ -44,7 +44,6 @@ interface ClientFingerprintUseCase { suspend operator fun invoke(userId: UserId, clientId: ClientId): Result } - class ClientFingerprintUseCaseImpl internal constructor( private val proteusClientProvider: ProteusClientProvider, private val prekeyRepository: PreKeyRepository From df987f32804e0043686c3306afb975e99e04aaec Mon Sep 17 00:00:00 2001 From: Yamil Medina Date: Tue, 24 Oct 2023 06:48:18 -0300 Subject: [PATCH 5/9] chore: architectural fitness functions - use case implementation visibility pt1. (ACOL-123) (#2152) * chore: fix visibility of use cases, implementations must be internal to create instances * chore: fix detekt --- .../feature/asset/UpdateAssetMessageDownloadStatusUseCase.kt | 2 +- .../call/usecase/EndCallOnConversationChangeUseCase.kt | 2 +- .../wire/kalium/logic/feature/call/usecase/EndCallUseCase.kt | 2 +- .../kalium/logic/feature/call/usecase/UnMuteCallUseCase.kt | 2 +- .../kalium/logic/feature/client/CleareNewClientsForUser.kt | 3 ++- .../logic/feature/client/FetchSelfClientsFromRemoteUseCase.kt | 2 +- .../kalium/logic/feature/client/GetOrRegisterClientUseCase.kt | 2 +- .../feature/client/IsAllowedToRegisterMLSClientUseCase.kt | 2 +- .../logic/feature/client/NeedsToRegisterClientUseCase.kt | 2 +- .../logic/feature/client/ObserveClientDetailsUseCase.kt | 2 +- .../kalium/logic/feature/client/RegisterMLSClientUseCase.kt | 2 +- .../feature/conversation/AddMemberToConversationUseCase.kt | 2 +- .../conversation/GetConversationUnreadEventsCountUseCase.kt | 2 +- .../logic/feature/conversation/LeaveConversationUseCase.kt | 2 +- .../logic/feature/conversation/LeaveSubconversationUseCase.kt | 2 +- .../ObserveArchivedUnreadConversationsCountUseCase.kt | 2 +- .../conversation/RemoveMemberFromConversationUseCase.kt | 2 +- .../keyingmaterials/UpdateKeyingMaterialsUseCase.kt | 2 +- .../logic/feature/keypackage/MLSKeyPackageCountUseCase.kt | 2 +- .../logic/feature/keypackage/RefillKeyPackageUseCase.kt | 2 +- .../feature/rootDetection/CheckSystemIntegrityUseCase.kt | 2 +- .../PersistNewSelfDeletionTimerUseCase.kt | 2 +- .../kalium/logic/feature/session/DeregisterTokenUseCase.kt | 2 +- .../kalium/logic/feature/user/IsFileSharingEnabledUseCase.kt | 2 +- .../feature/user/MarkSelfDeletionStatusAsNotifiedUseCase.kt | 2 +- .../logic/feature/user/ObserveFileSharingStatusUseCase.kt | 4 +++- .../UpdateSupportedProtocolsAndResolveOneOnOnesUseCase.kt | 2 +- 27 files changed, 30 insertions(+), 27 deletions(-) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/UpdateAssetMessageDownloadStatusUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/UpdateAssetMessageDownloadStatusUseCase.kt index cf24c845b83..c1e18d67dde 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/UpdateAssetMessageDownloadStatusUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/UpdateAssetMessageDownloadStatusUseCase.kt @@ -41,7 +41,7 @@ interface UpdateAssetMessageDownloadStatusUseCase { ): UpdateDownloadStatusResult } -class UpdateAssetMessageDownloadStatusUseCaseImpl( +internal class UpdateAssetMessageDownloadStatusUseCaseImpl( private val messageRepository: MessageRepository ) : UpdateAssetMessageDownloadStatusUseCase { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallOnConversationChangeUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallOnConversationChangeUseCase.kt index cfc7f18dd8c..2432a3b92da 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallOnConversationChangeUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallOnConversationChangeUseCase.kt @@ -17,7 +17,7 @@ interface EndCallOnConversationChangeUseCase { suspend operator fun invoke() } -class EndCallOnConversationChangeUseCaseImpl( +internal class EndCallOnConversationChangeUseCaseImpl( private val callRepository: CallRepository, private val conversationRepository: ConversationRepository, private val endCallUseCase: EndCallUseCase diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallUseCase.kt index 0c205770cb9..a71edf000a6 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallUseCase.kt @@ -43,7 +43,7 @@ interface EndCallUseCase { /** * This use case is responsible for ending a call. */ -class EndCallUseCaseImpl( +internal class EndCallUseCaseImpl( private val callManager: Lazy, private val callRepository: CallRepository, private val dispatchers: KaliumDispatcher = KaliumDispatcherImpl diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/UnMuteCallUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/UnMuteCallUseCase.kt index 7adb3008956..f976eb727b0 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/UnMuteCallUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/UnMuteCallUseCase.kt @@ -32,7 +32,7 @@ interface UnMuteCallUseCase { ) } -class UnMuteCallUseCaseImpl( +internal class UnMuteCallUseCaseImpl( private val callManager: Lazy, private val callRepository: CallRepository ) : UnMuteCallUseCase { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/CleareNewClientsForUser.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/CleareNewClientsForUser.kt index e1f114b6880..7183685b9ee 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/CleareNewClientsForUser.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/CleareNewClientsForUser.kt @@ -28,7 +28,8 @@ interface ClearNewClientsForUserUseCase { suspend operator fun invoke(userId: UserId) } -class ClearNewClientsForUserUseCaseImpl(private val userSessionScopeProvider: UserSessionScopeProvider) : ClearNewClientsForUserUseCase { +internal class ClearNewClientsForUserUseCaseImpl(private val userSessionScopeProvider: UserSessionScopeProvider) : + ClearNewClientsForUserUseCase { override suspend fun invoke(userId: UserId) { userSessionScopeProvider.getOrCreate(userId) .clientRepository diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/FetchSelfClientsFromRemoteUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/FetchSelfClientsFromRemoteUseCase.kt index 0e4c1eabee3..01332723835 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/FetchSelfClientsFromRemoteUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/FetchSelfClientsFromRemoteUseCase.kt @@ -37,7 +37,7 @@ interface FetchSelfClientsFromRemoteUseCase { suspend operator fun invoke(): SelfClientsResult } -class FetchSelfClientsFromRemoteUseCaseImpl( +internal class FetchSelfClientsFromRemoteUseCaseImpl( private val clientRepository: ClientRepository, private val provideClientId: CurrentClientIdProvider, ) : FetchSelfClientsFromRemoteUseCase { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/GetOrRegisterClientUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/GetOrRegisterClientUseCase.kt index 9a1889d05d1..ad8bfd8ec8f 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/GetOrRegisterClientUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/GetOrRegisterClientUseCase.kt @@ -38,7 +38,7 @@ interface GetOrRegisterClientUseCase { } @Suppress("LongParameterList") -class GetOrRegisterClientUseCaseImpl( +internal class GetOrRegisterClientUseCaseImpl( private val clientRepository: ClientRepository, private val pushTokenRepository: PushTokenRepository, private val logoutRepository: LogoutRepository, diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/IsAllowedToRegisterMLSClientUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/IsAllowedToRegisterMLSClientUseCase.kt index 06f248e2dc4..4a8a03a640b 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/IsAllowedToRegisterMLSClientUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/IsAllowedToRegisterMLSClientUseCase.kt @@ -36,7 +36,7 @@ interface IsAllowedToRegisterMLSClientUseCase { } @OptIn(DelicateKaliumApi::class) -class IsAllowedToRegisterMLSClientUseCaseImpl( +internal class IsAllowedToRegisterMLSClientUseCaseImpl( private val featureSupport: FeatureSupport, private val mlsPublicKeysRepository: MLSPublicKeysRepository, ) : IsAllowedToRegisterMLSClientUseCase { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/NeedsToRegisterClientUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/NeedsToRegisterClientUseCase.kt index ece3ee41046..889a1e0f1d3 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/NeedsToRegisterClientUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/NeedsToRegisterClientUseCase.kt @@ -32,7 +32,7 @@ interface NeedsToRegisterClientUseCase { suspend operator fun invoke(): Boolean } -class NeedsToRegisterClientUseCaseImpl( +internal class NeedsToRegisterClientUseCaseImpl( private val currentClientIdProvider: CurrentClientIdProvider, private val sessionRepository: SessionRepository, private val proteusClientProvider: ProteusClientProvider, diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ObserveClientDetailsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ObserveClientDetailsUseCase.kt index e69f8ca8642..0768cf810e4 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ObserveClientDetailsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ObserveClientDetailsUseCase.kt @@ -40,7 +40,7 @@ interface ObserveClientDetailsUseCase { suspend operator fun invoke(userId: UserId, clientId: ClientId): Flow } -class ObserveClientDetailsUseCaseImpl( +internal class ObserveClientDetailsUseCaseImpl( private val clientRepository: ClientRepository, private val provideClientId: CurrentClientIdProvider ) : ObserveClientDetailsUseCase { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/RegisterMLSClientUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/RegisterMLSClientUseCase.kt index e692063078d..8ff8418f88a 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/RegisterMLSClientUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/RegisterMLSClientUseCase.kt @@ -35,7 +35,7 @@ interface RegisterMLSClientUseCase { suspend operator fun invoke(clientId: ClientId): Either } -class RegisterMLSClientUseCaseImpl( +internal class RegisterMLSClientUseCaseImpl( private val mlsClientProvider: MLSClientProvider, private val clientRepository: ClientRepository, private val keyPackageRepository: KeyPackageRepository, diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/AddMemberToConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/AddMemberToConversationUseCase.kt index d9601951779..e23531f56f4 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/AddMemberToConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/AddMemberToConversationUseCase.kt @@ -41,7 +41,7 @@ interface AddMemberToConversationUseCase { } } -class AddMemberToConversationUseCaseImpl( +internal class AddMemberToConversationUseCaseImpl( private val conversationGroupRepository: ConversationGroupRepository ) : AddMemberToConversationUseCase { override suspend fun invoke(conversationId: ConversationId, userIdList: List): AddMemberToConversationUseCase.Result { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/GetConversationUnreadEventsCountUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/GetConversationUnreadEventsCountUseCase.kt index d5c2eddbc09..240f3222528 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/GetConversationUnreadEventsCountUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/GetConversationUnreadEventsCountUseCase.kt @@ -35,7 +35,7 @@ interface GetConversationUnreadEventsCountUseCase { } } -class GetConversationUnreadEventsCountUseCaseImpl( +internal class GetConversationUnreadEventsCountUseCaseImpl( private val conversationRepository: ConversationRepository ) : GetConversationUnreadEventsCountUseCase { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/LeaveConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/LeaveConversationUseCase.kt index 1acd70a1d5b..75d6f1eaa59 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/LeaveConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/LeaveConversationUseCase.kt @@ -34,7 +34,7 @@ interface LeaveConversationUseCase { suspend operator fun invoke(conversationId: ConversationId): RemoveMemberFromConversationUseCase.Result } -class LeaveConversationUseCaseImpl( +internal class LeaveConversationUseCaseImpl( private val conversationGroupRepository: ConversationGroupRepository, private val selfUserId: UserId, ) : LeaveConversationUseCase { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/LeaveSubconversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/LeaveSubconversationUseCase.kt index 026da046df9..d6bcc1b18c6 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/LeaveSubconversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/LeaveSubconversationUseCase.kt @@ -41,7 +41,7 @@ interface LeaveSubconversationUseCase { suspend operator fun invoke(conversationId: ConversationId, subconversationId: SubconversationId): Either } -class LeaveSubconversationUseCaseImpl( +internal class LeaveSubconversationUseCaseImpl( val conversationApi: ConversationApi, val mlsClientProvider: MLSClientProvider, val subconversationRepository: SubconversationRepository, diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ObserveArchivedUnreadConversationsCountUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ObserveArchivedUnreadConversationsCountUseCase.kt index d386fba0ade..458f644e132 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ObserveArchivedUnreadConversationsCountUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ObserveArchivedUnreadConversationsCountUseCase.kt @@ -28,7 +28,7 @@ interface ObserveArchivedUnreadConversationsCountUseCase { suspend operator fun invoke(): Flow } -class ObserveArchivedUnreadConversationsCountUseCaseImpl( +internal class ObserveArchivedUnreadConversationsCountUseCaseImpl( private val conversationRepository: ConversationRepository ) : ObserveArchivedUnreadConversationsCountUseCase { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RemoveMemberFromConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RemoveMemberFromConversationUseCase.kt index 1096f065969..241b846e752 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RemoveMemberFromConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RemoveMemberFromConversationUseCase.kt @@ -41,7 +41,7 @@ interface RemoveMemberFromConversationUseCase { } } -class RemoveMemberFromConversationUseCaseImpl( +internal class RemoveMemberFromConversationUseCaseImpl( private val conversationGroupRepository: ConversationGroupRepository ) : RemoveMemberFromConversationUseCase { override suspend fun invoke(conversationId: ConversationId, userIdToRemove: UserId): RemoveMemberFromConversationUseCase.Result { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/keyingmaterials/UpdateKeyingMaterialsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/keyingmaterials/UpdateKeyingMaterialsUseCase.kt index c594ab28633..f1f1fea45ba 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/keyingmaterials/UpdateKeyingMaterialsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/keyingmaterials/UpdateKeyingMaterialsUseCase.kt @@ -40,7 +40,7 @@ interface UpdateKeyingMaterialsUseCase { suspend operator fun invoke(): UpdateKeyingMaterialsResult } -class UpdateKeyingMaterialsUseCaseImpl( +internal class UpdateKeyingMaterialsUseCaseImpl( val mlsConversationRepository: MLSConversationRepository, private val updateKeyingMaterialThresholdProvider: UpdateKeyingMaterialThresholdProvider ) : UpdateKeyingMaterialsUseCase { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/MLSKeyPackageCountUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/MLSKeyPackageCountUseCase.kt index 4adc552294c..96eb524d3d6 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/MLSKeyPackageCountUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/MLSKeyPackageCountUseCase.kt @@ -33,7 +33,7 @@ interface MLSKeyPackageCountUseCase { suspend operator fun invoke(fromAPI: Boolean = true): MLSKeyPackageCountResult } -class MLSKeyPackageCountUseCaseImpl( +internal class MLSKeyPackageCountUseCaseImpl( private val keyPackageRepository: KeyPackageRepository, private val currentClientIdProvider: CurrentClientIdProvider, private val keyPackageLimitsProvider: KeyPackageLimitsProvider, diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCase.kt index 30f7991898c..20fde717108 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCase.kt @@ -44,7 +44,7 @@ interface RefillKeyPackagesUseCase { } -class RefillKeyPackagesUseCaseImpl( +internal class RefillKeyPackagesUseCaseImpl( private val keyPackageRepository: KeyPackageRepository, private val keyPackageLimitsProvider: KeyPackageLimitsProvider, private val currentClientIdProvider: CurrentClientIdProvider, diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/rootDetection/CheckSystemIntegrityUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/rootDetection/CheckSystemIntegrityUseCase.kt index ec3e624c772..d42c2fb148d 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/rootDetection/CheckSystemIntegrityUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/rootDetection/CheckSystemIntegrityUseCase.kt @@ -46,7 +46,7 @@ interface CheckSystemIntegrityUseCase { suspend fun invoke(): Result } -class CheckSystemIntegrityUseCaseImpl( +internal class CheckSystemIntegrityUseCaseImpl( private val kaliumConfigs: KaliumConfigs, private val rootDetector: RootDetector, private val sessionRepository: SessionRepository, diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/PersistNewSelfDeletionTimerUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/PersistNewSelfDeletionTimerUseCase.kt index 86934a0b428..7afd34668c1 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/PersistNewSelfDeletionTimerUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/PersistNewSelfDeletionTimerUseCase.kt @@ -33,7 +33,7 @@ interface PersistNewSelfDeletionTimerUseCase { suspend operator fun invoke(conversationId: ConversationId, newSelfDeletionTimer: SelfDeletionTimer) } -class PersistNewSelfDeletionTimerUseCaseImpl( +class PersistNewSelfDeletionTimerUseCaseImpl internal constructor( private val conversationRepository: ConversationRepository ) : PersistNewSelfDeletionTimerUseCase { override suspend fun invoke(conversationId: ConversationId, newSelfDeletionTimer: SelfDeletionTimer) = diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/DeregisterTokenUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/DeregisterTokenUseCase.kt index fff4cb020bc..e7877ba31a7 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/DeregisterTokenUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/DeregisterTokenUseCase.kt @@ -42,7 +42,7 @@ interface DeregisterTokenUseCase { } } -class DeregisterTokenUseCaseImpl( +internal class DeregisterTokenUseCaseImpl( private val clientRepository: ClientRepository, private val notificationTokenRepository: NotificationTokenRepository ) : DeregisterTokenUseCase { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/IsFileSharingEnabledUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/IsFileSharingEnabledUseCase.kt index 7d79fc6df7e..afad437a015 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/IsFileSharingEnabledUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/IsFileSharingEnabledUseCase.kt @@ -31,7 +31,7 @@ interface IsFileSharingEnabledUseCase { operator fun invoke(): FileSharingStatus } -class IsFileSharingEnabledUseCaseImpl( +internal class IsFileSharingEnabledUseCaseImpl( private val userConfigRepository: UserConfigRepository ) : IsFileSharingEnabledUseCase { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/MarkSelfDeletionStatusAsNotifiedUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/MarkSelfDeletionStatusAsNotifiedUseCase.kt index 90140b96531..0250da47980 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/MarkSelfDeletionStatusAsNotifiedUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/MarkSelfDeletionStatusAsNotifiedUseCase.kt @@ -27,7 +27,7 @@ interface MarkSelfDeletionStatusAsNotifiedUseCase { suspend operator fun invoke() } -class MarkSelfDeletionStatusAsNotifiedUseCaseImpl( +internal class MarkSelfDeletionStatusAsNotifiedUseCaseImpl( private val userConfigRepository: UserConfigRepository ) : MarkSelfDeletionStatusAsNotifiedUseCase { override suspend operator fun invoke() { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/ObserveFileSharingStatusUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/ObserveFileSharingStatusUseCase.kt index 40c8f74e9aa..fcc6b01d404 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/ObserveFileSharingStatusUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/ObserveFileSharingStatusUseCase.kt @@ -35,7 +35,8 @@ interface ObserveFileSharingStatusUseCase { operator fun invoke(): Flow } -class ObserveFileSharingStatusUseCaseImpl(private val userConfigRepository: UserConfigRepository) : ObserveFileSharingStatusUseCase { +internal class ObserveFileSharingStatusUseCaseImpl(private val userConfigRepository: UserConfigRepository) : + ObserveFileSharingStatusUseCase { override operator fun invoke(): Flow = userConfigRepository.isFileSharingEnabledFlow().map { fileSharingStatusFlow -> fileSharingStatusFlow.fold({ @@ -44,6 +45,7 @@ class ObserveFileSharingStatusUseCaseImpl(private val userConfigRepository: User kaliumLogger.e("Data not found in ObserveFileSharingStatusUseCase") FileSharingStatus(FileSharingStatus.Value.Disabled, false) } + is StorageFailure.Generic -> { kaliumLogger.e("Storage Error : ${it.rootCause} in ObserveFileSharingStatusUseCase", it.rootCause) FileSharingStatus(FileSharingStatus.Value.Disabled, false) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateSupportedProtocolsAndResolveOneOnOnesUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateSupportedProtocolsAndResolveOneOnOnesUseCase.kt index b42ff81ecc3..e50637bbbe3 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateSupportedProtocolsAndResolveOneOnOnesUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateSupportedProtocolsAndResolveOneOnOnesUseCase.kt @@ -36,7 +36,7 @@ interface UpdateSupportedProtocolsAndResolveOneOnOnesUseCase { suspend operator fun invoke(synchroniseUsers: Boolean): Either } -class UpdateSupportedProtocolsAndResolveOneOnOnesUseCaseImpl( +internal class UpdateSupportedProtocolsAndResolveOneOnOnesUseCaseImpl( private val updateSupportedProtocols: UpdateSupportedProtocolsUseCase, private val oneOnOneResolver: OneOnOneResolver ) : UpdateSupportedProtocolsAndResolveOneOnOnesUseCase { From 3f3a8afb67139bbcf61386b6015d86fb57cea2b6 Mon Sep 17 00:00:00 2001 From: yamilmedina Date: Fri, 3 Nov 2023 10:28:02 +0100 Subject: [PATCH 6/9] fix: broken use case rule --- .../logic/feature/e2ei/usecase/GetE2EICertificateUseCase.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/e2ei/usecase/GetE2EICertificateUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/e2ei/usecase/GetE2EICertificateUseCase.kt index 052cd69409d..62ca6be50f5 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/e2ei/usecase/GetE2EICertificateUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/e2ei/usecase/GetE2EICertificateUseCase.kt @@ -30,7 +30,7 @@ interface GetE2eiCertificateUseCase { suspend operator fun invoke(clientId: ClientId): GetE2EICertificateUseCaseResult } -class GetE2eiCertificateUseCaseImpl( +class GetE2eiCertificateUseCaseImpl internal constructor( private val mlsConversationRepository: MLSConversationRepository, private val pemCertificateDecoder: PemCertificateDecoder ) : GetE2eiCertificateUseCase { @@ -46,7 +46,7 @@ class GetE2eiCertificateUseCaseImpl( ) } -sealed class GetE2EICertificateUseCaseResult { +sealed class GetE2EICertificateUseCaseResult {c class Success(val certificate: E2eiCertificate) : GetE2EICertificateUseCaseResult() sealed class Failure : GetE2EICertificateUseCaseResult() { data object NotActivated : Failure() From a9ea37b1464db40fadc72259fb6ee5dca8aab536 Mon Sep 17 00:00:00 2001 From: yamilmedina Date: Fri, 3 Nov 2023 10:28:39 +0100 Subject: [PATCH 7/9] fix: broken use case rule --- .../logic/feature/e2ei/usecase/GetE2EICertificateUseCase.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/e2ei/usecase/GetE2EICertificateUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/e2ei/usecase/GetE2EICertificateUseCase.kt index 62ca6be50f5..9957e1243ff 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/e2ei/usecase/GetE2EICertificateUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/e2ei/usecase/GetE2EICertificateUseCase.kt @@ -46,7 +46,7 @@ class GetE2eiCertificateUseCaseImpl internal constructor( ) } -sealed class GetE2EICertificateUseCaseResult {c +sealed class GetE2EICertificateUseCaseResult { class Success(val certificate: E2eiCertificate) : GetE2EICertificateUseCaseResult() sealed class Failure : GetE2EICertificateUseCaseResult() { data object NotActivated : Failure() From 300b64fc6c025c6fc0e2e86f83195b4707e34f1e Mon Sep 17 00:00:00 2001 From: Yamil Medina Date: Mon, 6 Nov 2023 10:12:08 -0300 Subject: [PATCH 8/9] chore: architectural fitness functions - misc dtos inverted layer access pt2. (ACOL-123) (#2187) * fix: broken inversed layer rule * fix: broken inversed layer rule * fix: test adj * Revert "fix: broken inversed layer rule" This reverts commit 2153ceacef01da7c7721e6cdfeb7d333b00de764. * fix: test adj * fix: auth dto in wrong package * fix: session establisher dto in wrong package * fix: session establisher dto in wrong package * fix: message releated dtos in wrong package * chore: architectural fitness functions - inverted layer access calling pt3. (ACOL-123) (#2188) * fix: calling releated dtos in wrong package * fix: calling references with internal usecases * fix: calling references with internal usecases * chore: architectural fitness functions - inverted layer access msg and conversations pt4. (ACOL-123) (#2190) * fix: messages and conversation references with internal usecases * fix: messages and conversation references with internal usecases * fix: messages and conversation references with internal usecases --- .../logic/feature/call/CallManagerTest.kt | 2 +- .../call/scenario/OnIncomingCallTest.kt | 2 +- .../logic/feature/call/GlobalCallManager.kt | 2 +- .../logic/feature/call/CallManagerImpl.kt | 3 ++- .../logic/feature/call/GlobalCallManager.kt | 2 +- .../feature/call/scenario/OnAnsweredCall.kt | 2 +- .../feature/call/scenario/OnCloseCall.kt | 2 +- .../call/scenario/OnEstablishedCall.kt | 2 +- .../feature/call/scenario/OnHttpRequest.kt | 2 +- .../feature/call/scenario/OnIncomingCall.kt | 2 +- .../logic/feature/call/scenario/OnSendOTR.kt | 3 +-- .../configuration/UserConfigRepository.kt | 6 ++--- .../{feature => data}/auth/AuthSession.kt | 2 +- .../logic/data/auth/login/LoginRepository.kt | 2 +- .../logic/{feature => data}/call/Call.kt | 3 +-- .../logic/data/call/CallMetadataProfile.kt | 1 - .../kalium/logic/data/call/CallRepository.kt | 6 ++--- .../data/call/CallingParticipantsOrder.kt | 2 +- .../logic/data/call/mapper/CallMapper.kt | 6 ++--- .../logic/data/client/E2EIClientProvider.kt | 2 +- .../logic/data/client/MLSClientProvider.kt | 2 +- .../client}/ProteusClientProvider.kt | 2 +- .../client/UserClientRepositoryProvider.kt | 3 +++ .../ConversationGroupRepository.kt | 3 +-- .../conversation/ConversationRepository.kt | 4 ++-- .../JoinExistingMLSConversationUseCase.kt | 5 +--- .../JoinExistingMLSConversationsUseCase.kt | 3 +-- .../JoinSubconversationUseCase.kt | 23 +++++++++++++++---- .../LeaveSubconversationUseCase.kt | 7 +++--- ...wGroupConversationSystemMessagesCreator.kt | 7 ++++-- .../kalium/logic/data/e2ei/E2EIRepository.kt | 2 +- .../logic/data/event/EventRepository.kt | 2 +- .../logic/{feature => data/id}/IdProviders.kt | 3 +-- .../data/keypackage/KeyPackageRepository.kt | 2 +- .../message/BroadcastMessageOption.kt | 2 +- .../message/BroadcastMessageTarget.kt | 2 +- .../logic/data/message/MessageRepository.kt | 2 -- .../message/MessageTarget.kt | 2 +- .../message}/SelfDeletionMapper.kt | 2 +- .../message}/SelfDeletionTimer.kt | 2 +- .../message/SessionEstablisher.kt | 4 ++-- .../logic/data/prekey/PreKeyRepository.kt | 8 +++---- .../register/RegisterAccountRepository.kt | 2 +- .../logic/data/session/SessionMapper.kt | 6 ++--- .../logic/data/session/SessionRepository.kt | 8 +++---- .../kalium/logic/data/user/UserRepository.kt | 2 +- .../kalium/logic/feature/UserSessionScope.kt | 20 +++++++++------- .../asset/ScheduleNewAssetMessageUseCase.kt | 2 +- .../auth/AddAuthenticatedUserUseCase.kt | 1 + .../kalium/logic/feature/auth/LoginUseCase.kt | 1 + .../auth/sso/GetSSOLoginSessionUseCase.kt | 2 +- .../logic/feature/backup/BackupScope.kt | 2 +- .../feature/backup/CreateBackupUseCase.kt | 2 +- .../feature/backup/RestoreBackupUseCase.kt | 3 +-- .../kalium/logic/feature/call/CallsScope.kt | 2 +- .../logic/feature/call/GlobalCallManager.kt | 2 +- .../feature/call/usecase/AnswerCallUseCase.kt | 2 +- .../feature/call/usecase/EndCallUseCase.kt | 2 +- ...etAllCallsWithSortedParticipantsUseCase.kt | 2 +- .../call/usecase/GetIncomingCallsUseCase.kt | 2 +- .../call/usecase/IsCallRunningUseCase.kt | 2 +- .../usecase/ObserveEstablishedCallsUseCase.kt | 2 +- .../usecase/ObserveOngoingCallsUseCase.kt | 2 +- .../feature/call/usecase/RejectCallUseCase.kt | 2 +- .../feature/client/ClearClientDataUseCase.kt | 2 +- .../client/ClientFingerprintUseCase.kt | 2 +- .../logic/feature/client/ClientScope.kt | 4 ++-- .../FetchSelfClientsFromRemoteUseCase.kt | 2 +- .../logic/feature/client/MLSClientManager.kt | 2 +- .../client/NeedsToRegisterClientUseCase.kt | 6 ++--- .../client/ObserveClientDetailsUseCase.kt | 2 +- .../ClearConversationContentUseCase.kt | 2 +- .../feature/conversation/ConversationScope.kt | 6 ++--- .../CreateGroupConversationUseCase.kt | 2 +- .../RecoverMLSConversationsUseCase.kt | 1 + .../UpdateConversationReadDateUseCase.kt | 2 +- .../mls/MLSOneOnOneConversationResolver.kt | 2 +- .../feature/debug/BreakSessionUseCase.kt | 2 +- .../kalium/logic/feature/debug/DebugScope.kt | 8 +++---- .../SendBrokenAssetMessageUseCaseImpl.kt | 2 +- .../feature/debug/SendConfirmationUseCase.kt | 2 +- .../SelfDeletingMessagesConfigHandler.kt | 4 ++-- .../keypackage/MLSKeyPackageCountUseCase.kt | 2 +- .../keypackage/RefillKeyPackageUseCase.kt | 2 +- .../feature/message/DeleteMessageUseCase.kt | 2 +- .../feature/message/MessageEnvelopeCreator.kt | 2 +- .../logic/feature/message/MessageScope.kt | 6 +++-- .../logic/feature/message/MessageSender.kt | 4 ++++ .../message/SendConfirmationUseCase.kt | 2 +- .../message/SendEditTextMessageUseCase.kt | 2 +- .../logic/feature/message/SendKnockUseCase.kt | 2 +- .../feature/message/SendTextMessageUseCase.kt | 2 +- .../feature/message/SessionResetSender.kt | 3 ++- .../feature/message/StaleEpochVerifier.kt | 2 +- .../feature/message/ToggleReactionUseCase.kt | 2 +- .../SendButtonActionMessageUseCase.kt | 4 ++-- ...eralMessageForSelfUserAsReceiverUseCase.kt | 4 ++-- .../logic/feature/mlsmigration/MLSMigrator.kt | 2 +- .../register/RegisterAccountUseCase.kt | 2 +- ...tionTimerSettingsForConversationUseCase.kt | 2 ++ ...veTeamSettingsSelfDeletingStatusUseCase.kt | 2 ++ .../PersistNewSelfDeletionTimerUseCase.kt | 1 + .../service/ObserveAllServicesUseCase.kt | 2 +- .../logic/feature/service/ServiceScope.kt | 2 +- .../feature/session/CurrentSessionUseCase.kt | 2 +- .../logic/feature/session/SessionResult.kt | 2 +- .../session/token/AccessTokenRefresher.kt | 2 +- .../sessionreset/ResetSessionUseCase.kt | 2 +- .../team/DeleteTeamConversationUseCase.kt | 2 +- .../kalium/logic/feature/team/TeamScope.kt | 2 +- .../feature/user/IsSelfATeamMemberUseCase.kt | 2 +- .../UpdateSelfAvailabilityStatusUseCase.kt | 4 ++-- .../kalium/logic/feature/user/UserScope.kt | 2 +- ...ObserveScreenshotCensoringConfigUseCase.kt | 2 +- ...sistentWebSocketConnectionStatusUseCase.kt | 2 +- .../kalium/logic/network/ApiMigrationV3.kt | 2 +- .../logic/sync/receiver/UserEventReceiver.kt | 2 +- .../NewConversationEventHandler.kt | 2 +- .../message/ProteusMessageUnpacker.kt | 2 +- .../kalium/logic/sync/slow/SlowSyncWorker.kt | 2 +- .../kalium/logic/data/call/CallMapperTest.kt | 3 +-- .../logic/data/call/CallRepositoryTest.kt | 7 ++---- .../data/call/CallingParticipantsOrderTest.kt | 2 +- .../connection/ConnectionRepositoryTest.kt | 6 +---- .../ConversationGroupRepositoryTest.kt | 3 +-- .../ConversationRepositoryTest.kt | 2 +- ...upConversationSystemMessagesCreatorTest.kt | 16 ++++++------- .../logic/data/e2ei/E2EIRepositoryTest.kt | 2 +- .../logic/data/event/EventRepositoryTest.kt | 2 +- .../keypackage/KeyPackageRepositoryTest.kt | 2 +- .../data/message/MessageRepositoryTest.kt | 2 -- ...MessageForSelfUserAsReceiverUseCaseTest.kt | 2 +- .../logic/data/prekey/PreKeyRepositoryTest.kt | 4 ++-- .../register/RegisterAccountRepositoryTest.kt | 2 +- .../logic/data/session/SessionMapperTest.kt | 2 +- .../logic/data/user/UserRepositoryTest.kt | 3 +-- .../ScheduleNewAssetMessageUseCaseTest.kt | 4 ++-- .../auth/AddAuthenticatedUserUseCaseTest.kt | 3 +++ .../logic/feature/auth/LoginUseCaseTest.kt | 1 + .../logic/feature/auth/LogoutUseCaseTest.kt | 3 ++- .../feature/backup/CreateBackupUseCaseTest.kt | 2 +- .../backup/RestoreBackupUseCaseTest.kt | 2 +- .../call/usecase/AnswerCallUseCaseTest.kt | 4 ++-- .../EndCallOnConversationChangeUseCaseTest.kt | 4 ++-- .../call/usecase/EndCallUseCaseTest.kt | 4 ++-- ...lCallsWithSortedParticipantsUseCaseTest.kt | 4 ++-- .../usecase/GetIncomingCallsUseCaseTest.kt | 2 +- .../call/usecase/IsCallRunningUseCaseTest.kt | 4 ++-- .../call/usecase/MuteCallUseCaseTest.kt | 4 ++-- .../usecase/ObserveOngoingCallsUseCaseTest.kt | 4 ++-- .../call/usecase/RejectCallUseCaseTest.kt | 2 +- .../call/usecase/UnMuteCallUseCaseTest.kt | 4 ++-- ...rsationClientsForCurrentCallUseCaseTest.kt | 4 ++-- .../usecase/UpdateVideoStateUseCaseTest.kt | 4 ++-- .../client/ClientFingerprintUseCaseTest.kt | 2 +- .../feature/client/MLSClientManagerTest.kt | 3 +-- .../NeedsToRegisterClientUseCaseTest.kt | 6 ++--- .../client/ObserveClientDetailsUseCaseTest.kt | 6 +---- .../client/ObserveNewClientsUseCaseTest.kt | 2 +- .../feature/client/SelfClientsUseCaseTest.kt | 5 +--- .../ClearConversationContentUseCaseTest.kt | 3 +-- .../CreateGroupConversationUseCaseTest.kt | 2 +- .../JoinExistingMLSConversationUseCaseTest.kt | 3 +-- ...JoinExistingMLSConversationsUseCaseTest.kt | 3 ++- .../JoinSubconversationUseCaseTest.kt | 1 + .../LeaveSubconversationUseCaseTest.kt | 3 ++- .../RecoverMLSConversationsUseCaseTests.kt | 2 +- .../SyncFeatureConfigsUseCaseTest.kt | 4 ++-- .../MLSKeyPackageCountUseCaseTest.kt | 2 +- .../keypackage/RefillKeyPackageUseCaseTest.kt | 2 +- .../message/CryptoSessionMapperTest.kt | 2 ++ .../message/DeleteMessageUseCaseTest.kt | 2 +- .../message/MessageEnvelopeCreatorTest.kt | 2 +- .../feature/message/MessageSenderTest.kt | 4 ++++ .../message/SendButtonActionMessageTest.kt | 1 + .../message/SendConfirmationUseCaseTest.kt | 2 +- .../message/SendEditTextMessageUseCaseTest.kt | 2 +- .../feature/message/SendKnockUserCaseTest.kt | 5 ++-- .../message/SendTextMessageCaseTest.kt | 4 ++-- .../feature/message/SessionEstablisherTest.kt | 4 +++- .../feature/message/SessionResetSenderTest.kt | 2 +- .../message/ToggleReactionUseCaseTest.kt | 2 +- .../feature/mlsmigration/MLSMigratorTest.kt | 2 +- .../register/RegisterAccountUseCaseTest.kt | 2 +- .../CheckSystemIntegrityUseCaseTest.kt | 2 +- .../ObserveSelfDeletingMessagesUseCaseTest.kt | 4 ++++ .../service/ObserveAllServicesUseCaseTest.kt | 2 +- .../session/CurrentSessionFlowUseCaseTest.kt | 2 +- .../session/CurrentSessionUseCaseTest.kt | 2 +- .../sessionreset/ResetSessionUseCaseTest.kt | 2 +- .../team/DeleteTeamConversationUseCaseTest.kt | 2 +- .../user/IsSelfATeamMemberUseCaseTest.kt | 2 +- ...rveScreenshotCensoringConfigUseCaseTest.kt | 4 ++-- .../wire/kalium/logic/framework/TestCall.kt | 4 ++-- .../logic/network/ApiMigrationV3Test.kt | 2 +- .../logic/network/SessionManagerTest.kt | 2 +- .../FeatureConfigEventReceiverTest.kt | 4 ++-- .../sync/receiver/UserEventReceiverTest.kt | 2 +- .../NewConversationEventHandlerTest.kt | 2 +- .../message/ProteusMessageUnpackerTest.kt | 3 +-- .../logic/sync/slow/SlowSyncWorkerTest.kt | 2 +- .../arrangement/MessageSenderArrangement.kt | 2 +- ...ttingsForConversationUseCaseArrangement.kt | 3 +-- .../CurrentClientIdProviderArrangement.kt | 2 +- .../provider/E2EIClientProviderArrangement.kt | 3 +-- ...istingMLSConversationUseCaseArrangement.kt | 2 +- .../architecture/LayerAccessRulesTest.kt | 12 +++++++--- .../logic/feature/scenario/OnCloseCallTest.kt | 2 +- .../feature/scenario/OnHttpRequestTest.kt | 2 +- .../OnMuteStateForSelfUserChangedTest.kt | 4 ++-- .../logic/feature/scenario/OnSendOTRTest.kt | 3 +-- .../kotlin/action/LoginActions.kt | 2 +- .../managed/ConversationRepository.kt | 2 +- 213 files changed, 335 insertions(+), 309 deletions(-) rename logic/src/commonMain/kotlin/com/wire/kalium/logic/{feature => data}/auth/AuthSession.kt (98%) rename logic/src/commonMain/kotlin/com/wire/kalium/logic/{feature => data}/call/Call.kt (94%) rename logic/src/commonMain/kotlin/com/wire/kalium/logic/{feature => data/client}/ProteusClientProvider.kt (98%) rename logic/src/commonMain/kotlin/com/wire/kalium/logic/{feature => data}/conversation/JoinExistingMLSConversationUseCase.kt (96%) rename logic/src/commonMain/kotlin/com/wire/kalium/logic/{feature => data}/conversation/JoinExistingMLSConversationsUseCase.kt (96%) rename logic/src/commonMain/kotlin/com/wire/kalium/logic/{feature => data}/conversation/JoinSubconversationUseCase.kt (88%) rename logic/src/commonMain/kotlin/com/wire/kalium/logic/{feature => data}/conversation/LeaveSubconversationUseCase.kt (94%) rename logic/src/commonMain/kotlin/com/wire/kalium/logic/{feature => data/id}/IdProviders.kt (92%) rename logic/src/commonMain/kotlin/com/wire/kalium/logic/{feature => data}/message/BroadcastMessageOption.kt (95%) rename logic/src/commonMain/kotlin/com/wire/kalium/logic/{feature => data}/message/BroadcastMessageTarget.kt (96%) rename logic/src/commonMain/kotlin/com/wire/kalium/logic/{feature => data}/message/MessageTarget.kt (96%) rename logic/src/commonMain/kotlin/com/wire/kalium/logic/{feature/selfDeletingMessages => data/message}/SelfDeletionMapper.kt (96%) rename logic/src/commonMain/kotlin/com/wire/kalium/logic/{feature/selfDeletingMessages => data/message}/SelfDeletionTimer.kt (98%) rename logic/src/commonMain/kotlin/com/wire/kalium/logic/{feature => data}/message/SessionEstablisher.kt (98%) diff --git a/logic/src/androidInstrumentedTest/kotlin/com/wire/kalium/logic/feature/call/CallManagerTest.kt b/logic/src/androidInstrumentedTest/kotlin/com/wire/kalium/logic/feature/call/CallManagerTest.kt index a4976836d9d..defd3d50eab 100644 --- a/logic/src/androidInstrumentedTest/kotlin/com/wire/kalium/logic/feature/call/CallManagerTest.kt +++ b/logic/src/androidInstrumentedTest/kotlin/com/wire/kalium/logic/feature/call/CallManagerTest.kt @@ -33,7 +33,7 @@ import com.wire.kalium.logic.data.message.Message import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.message.MessageSender import com.wire.kalium.logic.featureFlags.KaliumConfigs import com.wire.kalium.logic.test_util.TestKaliumDispatcher diff --git a/logic/src/androidInstrumentedTest/kotlin/com/wire/kalium/logic/feature/call/scenario/OnIncomingCallTest.kt b/logic/src/androidInstrumentedTest/kotlin/com/wire/kalium/logic/feature/call/scenario/OnIncomingCallTest.kt index eb3a7862243..45e1633c5cf 100644 --- a/logic/src/androidInstrumentedTest/kotlin/com/wire/kalium/logic/feature/call/scenario/OnIncomingCallTest.kt +++ b/logic/src/androidInstrumentedTest/kotlin/com/wire/kalium/logic/feature/call/scenario/OnIncomingCallTest.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.call.ConversationType import com.wire.kalium.logic.data.call.mapper.CallMapperImpl import com.wire.kalium.logic.data.id.QualifiedIdMapperImpl -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import com.wire.kalium.logic.featureFlags.KaliumConfigs import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.framework.TestConversation diff --git a/logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt b/logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt index dd924193fb3..43323a79792 100644 --- a/logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt +++ b/logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt @@ -28,7 +28,7 @@ import com.wire.kalium.logic.data.id.FederatedIdMapper import com.wire.kalium.logic.data.id.QualifiedID import com.wire.kalium.logic.data.id.QualifiedIdMapper import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.call.usecase.ConversationClientsInCallUpdater import com.wire.kalium.logic.feature.message.MessageSender import com.wire.kalium.logic.featureFlags.KaliumConfigs diff --git a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/CallManagerImpl.kt b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/CallManagerImpl.kt index 0ed1066b3c7..e444919ecf5 100644 --- a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/CallManagerImpl.kt +++ b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/CallManagerImpl.kt @@ -32,6 +32,7 @@ import com.wire.kalium.logic.callingLogger import com.wire.kalium.logic.data.call.CallClient import com.wire.kalium.logic.data.call.CallClientList import com.wire.kalium.logic.data.call.CallRepository +import com.wire.kalium.logic.data.call.CallStatus import com.wire.kalium.logic.data.call.CallType import com.wire.kalium.logic.data.call.ConversationType import com.wire.kalium.logic.data.call.EpochInfo @@ -49,7 +50,7 @@ import com.wire.kalium.logic.data.message.Message import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.call.scenario.OnActiveSpeakers import com.wire.kalium.logic.feature.call.scenario.OnAnsweredCall import com.wire.kalium.logic.feature.call.scenario.OnClientsRequest diff --git a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt index 669a8ae8860..b9b670e3641 100644 --- a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt +++ b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt @@ -33,7 +33,7 @@ import com.wire.kalium.logic.data.id.QualifiedID import com.wire.kalium.logic.data.id.QualifiedIdMapper import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.call.usecase.ConversationClientsInCallUpdater import com.wire.kalium.logic.feature.message.MessageSender import com.wire.kalium.logic.featureFlags.KaliumConfigs diff --git a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnAnsweredCall.kt b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnAnsweredCall.kt index 0fd26ce0b74..533bc997d5c 100644 --- a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnAnsweredCall.kt +++ b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnAnsweredCall.kt @@ -23,7 +23,7 @@ import com.wire.kalium.calling.callbacks.AnsweredCallHandler import com.wire.kalium.logic.callingLogger import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.id.QualifiedIdMapper -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch diff --git a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnCloseCall.kt b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnCloseCall.kt index 6467d935459..2d4d0519c5b 100644 --- a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnCloseCall.kt +++ b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnCloseCall.kt @@ -28,7 +28,7 @@ import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.QualifiedIdMapper -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch diff --git a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnEstablishedCall.kt b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnEstablishedCall.kt index 4a5d3e93514..ff76baac3ba 100644 --- a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnEstablishedCall.kt +++ b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnEstablishedCall.kt @@ -24,7 +24,7 @@ import com.wire.kalium.logger.obfuscateId import com.wire.kalium.logic.callingLogger import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.id.QualifiedIdMapper -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch diff --git a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnHttpRequest.kt b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnHttpRequest.kt index 10ebbe2d809..12542de687c 100644 --- a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnHttpRequest.kt +++ b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnHttpRequest.kt @@ -31,7 +31,7 @@ import com.wire.kalium.logic.data.message.Message import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.feature.message.MessageSender -import com.wire.kalium.logic.feature.message.MessageTarget +import com.wire.kalium.logic.data.message.MessageTarget import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.foldToEitherWhileRight diff --git a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnIncomingCall.kt b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnIncomingCall.kt index 29d616bdae9..ed8d609aeb8 100644 --- a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnIncomingCall.kt +++ b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnIncomingCall.kt @@ -27,7 +27,7 @@ import com.wire.kalium.logic.data.call.mapper.CallMapper import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.call.ConversationType import com.wire.kalium.logic.data.id.QualifiedIdMapper -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import com.wire.kalium.logic.featureFlags.KaliumConfigs import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.launch diff --git a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnSendOTR.kt b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnSendOTR.kt index 67c49855ec2..b5933a3daf5 100644 --- a/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnSendOTR.kt +++ b/logic/src/commonJvmAndroid/kotlin/com/wire/kalium/logic/feature/call/scenario/OnSendOTR.kt @@ -32,10 +32,9 @@ import com.wire.kalium.logic.data.id.QualifiedIdMapper import com.wire.kalium.logic.feature.call.AvsCallBackError import com.wire.kalium.logic.feature.call.CallManagerImpl import com.wire.kalium.logic.feature.message.MessageSender -import com.wire.kalium.logic.feature.message.MessageTarget +import com.wire.kalium.logic.data.message.MessageTarget import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Deferred -import kotlinx.serialization.decodeFromString import kotlinx.serialization.json.Json // TODO(testing): create unit test diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/UserConfigRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/UserConfigRepository.kt index 72cc39a7175..5eaa630415f 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/UserConfigRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/configuration/UserConfigRepository.kt @@ -26,9 +26,9 @@ import com.wire.kalium.logic.data.featureConfig.toModel import com.wire.kalium.logic.data.user.SupportedProtocol import com.wire.kalium.logic.data.user.toDao import com.wire.kalium.logic.data.user.toModel -import com.wire.kalium.logic.feature.selfDeletingMessages.SelfDeletionMapper.toSelfDeletionTimerEntity -import com.wire.kalium.logic.feature.selfDeletingMessages.SelfDeletionMapper.toTeamSelfDeleteTimer -import com.wire.kalium.logic.feature.selfDeletingMessages.TeamSettingsSelfDeletionStatus +import com.wire.kalium.logic.data.message.SelfDeletionMapper.toSelfDeletionTimerEntity +import com.wire.kalium.logic.data.message.SelfDeletionMapper.toTeamSelfDeleteTimer +import com.wire.kalium.logic.data.message.TeamSettingsSelfDeletionStatus import com.wire.kalium.logic.featureFlags.BuildFileRestrictionState import com.wire.kalium.logic.featureFlags.KaliumConfigs import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AuthSession.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/auth/AuthSession.kt similarity index 98% rename from logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AuthSession.kt rename to logic/src/commonMain/kotlin/com/wire/kalium/logic/data/auth/AuthSession.kt index c502971ddb8..9960d48d765 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AuthSession.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/auth/AuthSession.kt @@ -16,7 +16,7 @@ * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.kalium.logic.feature.auth +package com.wire.kalium.logic.data.auth import com.wire.kalium.logic.configuration.server.ServerConfig import com.wire.kalium.logic.data.logout.LogoutReason diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/auth/login/LoginRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/auth/login/LoginRepository.kt index 1a86ee247e3..f5891d2a783 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/auth/login/LoginRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/auth/login/LoginRepository.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.data.id.IdMapper import com.wire.kalium.logic.data.session.SessionMapper import com.wire.kalium.logic.data.user.SsoId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.auth.AccountTokens +import com.wire.kalium.logic.data.auth.AccountTokens import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.map import com.wire.kalium.logic.wrapApiRequest diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/Call.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/Call.kt similarity index 94% rename from logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/Call.kt rename to logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/Call.kt index 47d407c9d8a..4e7ed99dd37 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/Call.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/Call.kt @@ -16,9 +16,8 @@ * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.kalium.logic.feature.call +package com.wire.kalium.logic.data.call -import com.wire.kalium.logic.data.call.Participant import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallMetadataProfile.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallMetadataProfile.kt index 17238680373..aacbb98f099 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallMetadataProfile.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallMetadataProfile.kt @@ -20,7 +20,6 @@ package com.wire.kalium.logic.data.call import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId -import com.wire.kalium.logic.feature.call.CallStatus data class CallMetadataProfile( val data: Map diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallRepository.kt index 331239be55f..6e90c8c21d2 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallRepository.kt @@ -47,10 +47,8 @@ import com.wire.kalium.logic.data.team.TeamRepository import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.call.Call -import com.wire.kalium.logic.feature.call.CallStatus -import com.wire.kalium.logic.feature.conversation.JoinSubconversationUseCase -import com.wire.kalium.logic.feature.conversation.LeaveSubconversationUseCase +import com.wire.kalium.logic.data.conversation.JoinSubconversationUseCase +import com.wire.kalium.logic.data.conversation.LeaveSubconversationUseCase import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.getOrNull diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallingParticipantsOrder.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallingParticipantsOrder.kt index dc6b0a08caa..2a4c5308fb7 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallingParticipantsOrder.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/CallingParticipantsOrder.kt @@ -19,7 +19,7 @@ package com.wire.kalium.logic.data.call import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.fold internal interface CallingParticipantsOrder { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/mapper/CallMapper.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/mapper/CallMapper.kt index 17bdecad5b9..7773b1d3bcf 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/mapper/CallMapper.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/call/mapper/CallMapper.kt @@ -32,9 +32,9 @@ import com.wire.kalium.logic.data.conversation.Recipient import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.QualifiedIdMapper import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.call.Call -import com.wire.kalium.logic.feature.call.CallStatus -import com.wire.kalium.logic.feature.message.MessageTarget +import com.wire.kalium.logic.data.call.Call +import com.wire.kalium.logic.data.call.CallStatus +import com.wire.kalium.logic.data.message.MessageTarget import com.wire.kalium.persistence.dao.QualifiedIDEntity import com.wire.kalium.persistence.dao.call.CallEntity import com.wire.kalium.persistence.dao.conversation.ConversationEntity diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/E2EIClientProvider.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/E2EIClientProvider.kt index 92c17cc4cb7..d9d0ed31ae9 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/E2EIClientProvider.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/E2EIClientProvider.kt @@ -26,7 +26,7 @@ import com.wire.kalium.logic.E2EIFailure import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.fold diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/MLSClientProvider.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/MLSClientProvider.kt index b55c61394b2..aeab5e02418 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/MLSClientProvider.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/MLSClientProvider.kt @@ -26,7 +26,7 @@ import com.wire.kalium.cryptography.coreCryptoCentral import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.fold import com.wire.kalium.logic.util.SecurityHelperImpl diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/ProteusClientProvider.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/ProteusClientProvider.kt similarity index 98% rename from logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/ProteusClientProvider.kt rename to logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/ProteusClientProvider.kt index c4582442f27..0baf0cd8cf9 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/ProteusClientProvider.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/ProteusClientProvider.kt @@ -16,7 +16,7 @@ * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.kalium.logic.feature +package com.wire.kalium.logic.data.client import com.wire.kalium.cryptography.ProteusClient import com.wire.kalium.cryptography.coreCryptoCentral diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/UserClientRepositoryProvider.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/UserClientRepositoryProvider.kt index 3434f5eb150..6927319657e 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/UserClientRepositoryProvider.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/client/UserClientRepositoryProvider.kt @@ -15,6 +15,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ + +@file:Suppress("konsist.repositoriesShouldNotAccessFeaturePackageClasses") + package com.wire.kalium.logic.data.client import com.wire.kalium.logic.data.user.UserId diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationGroupRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationGroupRepository.kt index 3ba8be244dd..4760884d7b4 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationGroupRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationGroupRepository.kt @@ -30,8 +30,7 @@ import com.wire.kalium.logic.data.id.toModel import com.wire.kalium.logic.data.service.ServiceId import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.SelfTeamIdProvider -import com.wire.kalium.logic.feature.conversation.JoinExistingMLSConversationUseCase +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.map diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepository.kt index cf1a47f9ba8..93f90a2c80f 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepository.kt @@ -38,8 +38,8 @@ import com.wire.kalium.logic.data.message.MessageMapper import com.wire.kalium.logic.data.message.UnreadEventType import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.SelfTeamIdProvider -import com.wire.kalium.logic.feature.selfDeletingMessages.SelfDeletionTimer +import com.wire.kalium.logic.data.id.SelfTeamIdProvider +import com.wire.kalium.logic.data.message.SelfDeletionTimer import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.fold diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/JoinExistingMLSConversationUseCase.kt similarity index 96% rename from logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCase.kt rename to logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/JoinExistingMLSConversationUseCase.kt index 9007ba1cecb..a62b28a37c3 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/JoinExistingMLSConversationUseCase.kt @@ -16,15 +16,12 @@ * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.kalium.logic.feature.conversation +package com.wire.kalium.logic.data.conversation import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.NetworkFailure import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.data.client.ClientRepository -import com.wire.kalium.logic.data.conversation.Conversation -import com.wire.kalium.logic.data.conversation.ConversationRepository -import com.wire.kalium.logic.data.conversation.MLSConversationRepository import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.toApi import com.wire.kalium.logic.featureFlags.FeatureSupport diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/JoinExistingMLSConversationsUseCase.kt similarity index 96% rename from logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCase.kt rename to logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/JoinExistingMLSConversationsUseCase.kt index b34a9a42eb7..262aef12fc8 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/JoinExistingMLSConversationsUseCase.kt @@ -16,12 +16,11 @@ * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.kalium.logic.feature.conversation +package com.wire.kalium.logic.data.conversation import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.client.ClientRepository import com.wire.kalium.logic.data.conversation.Conversation.ProtocolInfo.MLSCapable.GroupState -import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.featureFlags.FeatureSupport import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinSubconversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/JoinSubconversationUseCase.kt similarity index 88% rename from logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinSubconversationUseCase.kt rename to logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/JoinSubconversationUseCase.kt index f63689eb5f2..484ada66b2d 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinSubconversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/JoinSubconversationUseCase.kt @@ -1,9 +1,24 @@ -package com.wire.kalium.logic.feature.conversation +/* + * Wire + * Copyright (C) 2023 Wire Swiss GmbH + * + * 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 http://www.gnu.org/licenses/. + */ +package com.wire.kalium.logic.data.conversation import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.NetworkFailure -import com.wire.kalium.logic.data.conversation.MLSConversationRepository -import com.wire.kalium.logic.data.conversation.SubconversationRepository import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.GroupID import com.wire.kalium.logic.data.id.SubconversationId @@ -30,7 +45,7 @@ import kotlin.time.Duration /** * Join a sub-conversation of a MLS conversation */ -interface JoinSubconversationUseCase { +internal interface JoinSubconversationUseCase { suspend operator fun invoke(conversationId: ConversationId, subconversationId: SubconversationId): Either } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/LeaveSubconversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/LeaveSubconversationUseCase.kt similarity index 94% rename from logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/LeaveSubconversationUseCase.kt rename to logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/LeaveSubconversationUseCase.kt index d6bcc1b18c6..a9d28c4eafc 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/LeaveSubconversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/LeaveSubconversationUseCase.kt @@ -15,18 +15,17 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.kalium.logic.feature.conversation +package com.wire.kalium.logic.data.conversation import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.client.MLSClientProvider -import com.wire.kalium.logic.data.conversation.SubconversationRepository import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.GroupID import com.wire.kalium.logic.data.id.SubconversationId import com.wire.kalium.logic.data.id.toApi import com.wire.kalium.logic.data.id.toCrypto import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.wrapApiRequest @@ -37,7 +36,7 @@ import com.wire.kalium.network.api.base.authenticated.conversation.Subconversati /** * Leave a sub-conversation you've previously joined */ -interface LeaveSubconversationUseCase { +internal interface LeaveSubconversationUseCase { suspend operator fun invoke(conversationId: ConversationId, subconversationId: SubconversationId): Either } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/NewGroupConversationSystemMessagesCreator.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/NewGroupConversationSystemMessagesCreator.kt index 9c4bade1074..046fc23e0e6 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/NewGroupConversationSystemMessagesCreator.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/NewGroupConversationSystemMessagesCreator.kt @@ -21,14 +21,15 @@ import com.benasher44.uuid.uuid4 import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.QualifiedIdMapper +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.data.id.toModel import com.wire.kalium.logic.data.message.Message import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.message.PersistMessageUseCase import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.user.IsSelfATeamMemberUseCase import com.wire.kalium.logic.functional.Either +import com.wire.kalium.logic.functional.fold import com.wire.kalium.network.api.base.authenticated.conversation.ConversationResponse import com.wire.kalium.network.api.base.authenticated.conversation.ReceiptMode import com.wire.kalium.persistence.dao.ConversationIDEntity @@ -60,7 +61,7 @@ internal interface NewGroupConversationSystemMessagesCreator { internal class NewGroupConversationSystemMessagesCreatorImpl( private val persistMessage: PersistMessageUseCase, - private val isSelfATeamMember: IsSelfATeamMemberUseCase, + private val selfTeamIdProvider: SelfTeamIdProvider, private val qualifiedIdMapper: QualifiedIdMapper, private val selfUserId: UserId, private val memberMapper: MemberMapper = MapperProvider.memberMapper() @@ -212,4 +213,6 @@ internal class NewGroupConversationSystemMessagesCreatorImpl( expirationData = null ) ) + + private suspend fun isSelfATeamMember() = selfTeamIdProvider().fold({ false }, { it != null }) } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/e2ei/E2EIRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/e2ei/E2EIRepository.kt index 0cb47ad3888..a22075d5445 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/e2ei/E2EIRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/e2ei/E2EIRepository.kt @@ -27,7 +27,7 @@ import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.client.E2EIClientProvider import com.wire.kalium.logic.data.client.MLSClientProvider import com.wire.kalium.logic.data.conversation.MLSConversationRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.map diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/event/EventRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/event/EventRepository.kt index 386b2e222ba..2d866aede10 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/event/EventRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/event/EventRepository.kt @@ -24,7 +24,7 @@ import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.fold diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/IdProviders.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/id/IdProviders.kt similarity index 92% rename from logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/IdProviders.kt rename to logic/src/commonMain/kotlin/com/wire/kalium/logic/data/id/IdProviders.kt index 5d4bbedaddb..a43258ad16d 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/IdProviders.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/id/IdProviders.kt @@ -15,11 +15,10 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.kalium.logic.feature +package com.wire.kalium.logic.data.id import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.conversation.ClientId -import com.wire.kalium.logic.data.id.TeamId import com.wire.kalium.logic.functional.Either fun interface CurrentClientIdProvider { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/keypackage/KeyPackageRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/keypackage/KeyPackageRepository.kt index 165194c8910..a993a238bf2 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/keypackage/KeyPackageRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/keypackage/KeyPackageRepository.kt @@ -26,7 +26,7 @@ import com.wire.kalium.logic.data.id.IdMapper import com.wire.kalium.logic.data.id.toApi import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.foldToEitherWhileRight diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/BroadcastMessageOption.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/BroadcastMessageOption.kt similarity index 95% rename from logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/BroadcastMessageOption.kt rename to logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/BroadcastMessageOption.kt index e56a2563b6a..edae75ed478 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/BroadcastMessageOption.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/BroadcastMessageOption.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.kalium.logic.feature.message +package com.wire.kalium.logic.data.message import com.wire.kalium.logic.data.user.UserId diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/BroadcastMessageTarget.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/BroadcastMessageTarget.kt similarity index 96% rename from logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/BroadcastMessageTarget.kt rename to logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/BroadcastMessageTarget.kt index 66b984a623b..1c72a30fdfe 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/BroadcastMessageTarget.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/BroadcastMessageTarget.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.kalium.logic.feature.message +package com.wire.kalium.logic.data.message sealed class BroadcastMessageTarget(open val limit: Int) { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageRepository.kt index bc6f895d48c..3c853ec0987 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageRepository.kt @@ -35,8 +35,6 @@ import com.wire.kalium.logic.data.notification.LocalNotification import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.di.MapperProvider import com.wire.kalium.logic.failure.ProteusSendMessageFailure -import com.wire.kalium.logic.feature.message.BroadcastMessageOption -import com.wire.kalium.logic.feature.message.MessageTarget import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.fold diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageTarget.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageTarget.kt similarity index 96% rename from logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageTarget.kt rename to logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageTarget.kt index 936cef1ebc3..206319705f4 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageTarget.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/MessageTarget.kt @@ -16,7 +16,7 @@ * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.kalium.logic.feature.message +package com.wire.kalium.logic.data.message import com.wire.kalium.logic.data.conversation.Recipient import com.wire.kalium.logic.data.user.UserId diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/SelfDeletionMapper.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/SelfDeletionMapper.kt similarity index 96% rename from logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/SelfDeletionMapper.kt rename to logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/SelfDeletionMapper.kt index db01d57cf8f..41c8525ce65 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/SelfDeletionMapper.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/SelfDeletionMapper.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.kalium.logic.feature.selfDeletingMessages +package com.wire.kalium.logic.data.message import com.wire.kalium.persistence.config.SelfDeletionTimerEntity diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/SelfDeletionTimer.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/SelfDeletionTimer.kt similarity index 98% rename from logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/SelfDeletionTimer.kt rename to logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/SelfDeletionTimer.kt index 29086c4eec6..0de33b3efab 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/SelfDeletionTimer.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/SelfDeletionTimer.kt @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.kalium.logic.feature.selfDeletingMessages +package com.wire.kalium.logic.data.message import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.util.serialization.toJsonElement diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SessionEstablisher.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/SessionEstablisher.kt similarity index 98% rename from logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SessionEstablisher.kt rename to logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/SessionEstablisher.kt index 887cb7845bc..68d27e024f4 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SessionEstablisher.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/message/SessionEstablisher.kt @@ -16,7 +16,7 @@ * along with this program. If not, see http://www.gnu.org/licenses/. */ -package com.wire.kalium.logic.feature.message +package com.wire.kalium.logic.data.message import com.wire.kalium.cryptography.CryptoClientId import com.wire.kalium.cryptography.CryptoSessionId @@ -30,7 +30,7 @@ import com.wire.kalium.logic.data.prekey.PreKeyRepository import com.wire.kalium.logic.data.prekey.UsersWithoutSessions import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.foldToEitherWhileRight diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepository.kt index 5257de969ac..7e38cd32a01 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepository.kt @@ -27,10 +27,10 @@ import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.CurrentClientIdProvider -import com.wire.kalium.logic.feature.ProteusClientProvider -import com.wire.kalium.logic.feature.message.CryptoSessionMapper -import com.wire.kalium.logic.feature.message.CryptoSessionMapperImpl +import com.wire.kalium.logic.data.id.CurrentClientIdProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider +import com.wire.kalium.logic.data.message.CryptoSessionMapper +import com.wire.kalium.logic.data.message.CryptoSessionMapperImpl import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.onFailure diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/register/RegisterAccountRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/register/RegisterAccountRepository.kt index 07fe1266217..7578e3fd13a 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/register/RegisterAccountRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/register/RegisterAccountRepository.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.data.id.IdMapper import com.wire.kalium.logic.data.session.SessionMapper import com.wire.kalium.logic.data.user.SsoId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.auth.AccountTokens +import com.wire.kalium.logic.data.auth.AccountTokens import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.map import com.wire.kalium.logic.wrapApiRequest diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/session/SessionMapper.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/session/SessionMapper.kt index 3a73941fd10..56e2d30f88f 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/session/SessionMapper.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/session/SessionMapper.kt @@ -25,9 +25,9 @@ import com.wire.kalium.logic.data.id.toDao import com.wire.kalium.logic.data.id.toModel import com.wire.kalium.logic.data.logout.LogoutReason import com.wire.kalium.logic.data.user.SsoId -import com.wire.kalium.logic.feature.auth.AccountInfo -import com.wire.kalium.logic.feature.auth.AccountTokens -import com.wire.kalium.logic.feature.auth.PersistentWebSocketStatus +import com.wire.kalium.logic.data.auth.AccountInfo +import com.wire.kalium.logic.data.auth.AccountTokens +import com.wire.kalium.logic.data.auth.PersistentWebSocketStatus import com.wire.kalium.network.api.base.model.ProxyCredentialsDTO import com.wire.kalium.network.api.base.model.SessionDTO import com.wire.kalium.persistence.client.AuthTokenEntity diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/session/SessionRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/session/SessionRepository.kt index d15fd1e8b38..17699932ba4 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/session/SessionRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/session/SessionRepository.kt @@ -29,10 +29,10 @@ import com.wire.kalium.logic.data.logout.LogoutReason import com.wire.kalium.logic.data.user.SsoId import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.auth.Account -import com.wire.kalium.logic.feature.auth.AccountInfo -import com.wire.kalium.logic.feature.auth.AccountTokens -import com.wire.kalium.logic.feature.auth.PersistentWebSocketStatus +import com.wire.kalium.logic.data.auth.Account +import com.wire.kalium.logic.data.auth.AccountInfo +import com.wire.kalium.logic.data.auth.AccountTokens +import com.wire.kalium.logic.data.auth.PersistentWebSocketStatus import com.wire.kalium.logic.featureFlags.KaliumConfigs import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/user/UserRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/user/UserRepository.kt index 3373932fdca..febb0475911 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/user/UserRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/user/UserRepository.kt @@ -39,7 +39,7 @@ import com.wire.kalium.logic.data.user.type.UserEntityTypeMapper import com.wire.kalium.logic.data.user.type.isFederated import com.wire.kalium.logic.di.MapperProvider import com.wire.kalium.logic.failure.SelfUserDeleted -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.fold diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt index 0943c0edf8f..64dba177165 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt @@ -48,6 +48,8 @@ import com.wire.kalium.logic.data.client.E2EIClientProvider import com.wire.kalium.logic.data.client.EI2EIClientProviderImpl import com.wire.kalium.logic.data.client.MLSClientProvider import com.wire.kalium.logic.data.client.MLSClientProviderImpl +import com.wire.kalium.logic.data.client.ProteusClientProvider +import com.wire.kalium.logic.data.client.ProteusClientProviderImpl import com.wire.kalium.logic.data.client.remote.ClientRemoteDataSource import com.wire.kalium.logic.data.client.remote.ClientRemoteRepository import com.wire.kalium.logic.data.connection.ConnectionDataSource @@ -72,9 +74,11 @@ import com.wire.kalium.logic.data.event.EventDataSource import com.wire.kalium.logic.data.event.EventRepository import com.wire.kalium.logic.data.featureConfig.FeatureConfigDataSource import com.wire.kalium.logic.data.featureConfig.FeatureConfigRepository +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.data.id.FederatedIdMapper import com.wire.kalium.logic.data.id.GroupID import com.wire.kalium.logic.data.id.QualifiedIdMapper +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.data.id.TeamId import com.wire.kalium.logic.data.keypackage.KeyPackageDataSource import com.wire.kalium.logic.data.keypackage.KeyPackageLimitsProvider @@ -160,14 +164,14 @@ import com.wire.kalium.logic.feature.connection.SyncConnectionsUseCaseImpl import com.wire.kalium.logic.feature.conversation.ConversationScope import com.wire.kalium.logic.feature.conversation.ConversationsRecoveryManager import com.wire.kalium.logic.feature.conversation.ConversationsRecoveryManagerImpl -import com.wire.kalium.logic.feature.conversation.JoinExistingMLSConversationUseCase -import com.wire.kalium.logic.feature.conversation.JoinExistingMLSConversationUseCaseImpl -import com.wire.kalium.logic.feature.conversation.JoinExistingMLSConversationsUseCase -import com.wire.kalium.logic.feature.conversation.JoinExistingMLSConversationsUseCaseImpl -import com.wire.kalium.logic.feature.conversation.JoinSubconversationUseCase -import com.wire.kalium.logic.feature.conversation.JoinSubconversationUseCaseImpl -import com.wire.kalium.logic.feature.conversation.LeaveSubconversationUseCase -import com.wire.kalium.logic.feature.conversation.LeaveSubconversationUseCaseImpl +import com.wire.kalium.logic.data.conversation.JoinExistingMLSConversationUseCase +import com.wire.kalium.logic.data.conversation.JoinExistingMLSConversationUseCaseImpl +import com.wire.kalium.logic.data.conversation.JoinExistingMLSConversationsUseCase +import com.wire.kalium.logic.data.conversation.JoinExistingMLSConversationsUseCaseImpl +import com.wire.kalium.logic.data.conversation.JoinSubconversationUseCase +import com.wire.kalium.logic.data.conversation.JoinSubconversationUseCaseImpl +import com.wire.kalium.logic.data.conversation.LeaveSubconversationUseCase +import com.wire.kalium.logic.data.conversation.LeaveSubconversationUseCaseImpl import com.wire.kalium.logic.feature.conversation.MLSConversationsRecoveryManager import com.wire.kalium.logic.feature.conversation.MLSConversationsRecoveryManagerImpl import com.wire.kalium.logic.feature.conversation.MLSConversationsVerificationStatusesHandler diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCase.kt index e0598cbfb96..b2c12a2f20d 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCase.kt @@ -38,7 +38,7 @@ import com.wire.kalium.logic.data.properties.UserPropertyRepository import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.message.MessageSendFailureHandler import com.wire.kalium.logic.feature.message.MessageSender import com.wire.kalium.logic.feature.selfDeletingMessages.ObserveSelfDeletionTimerSettingsForConversationUseCase diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AddAuthenticatedUserUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AddAuthenticatedUserUseCase.kt index 4d7626fa083..3d237de3ca9 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AddAuthenticatedUserUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AddAuthenticatedUserUseCase.kt @@ -20,6 +20,7 @@ package com.wire.kalium.logic.feature.auth import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.configuration.server.ServerConfigRepository +import com.wire.kalium.logic.data.auth.AccountTokens import com.wire.kalium.logic.data.auth.login.ProxyCredentials import com.wire.kalium.logic.data.session.SessionRepository import com.wire.kalium.logic.data.user.SsoId diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/LoginUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/LoginUseCase.kt index 2d2886a2e24..a5bb02b9a24 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/LoginUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/LoginUseCase.kt @@ -22,6 +22,7 @@ import com.benasher44.uuid.uuid4 import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.NetworkFailure import com.wire.kalium.logic.configuration.server.ServerConfig +import com.wire.kalium.logic.data.auth.AccountTokens import com.wire.kalium.logic.data.auth.login.LoginRepository import com.wire.kalium.logic.data.auth.login.ProxyCredentials import com.wire.kalium.logic.data.auth.verification.SecondFactorVerificationRepository diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/GetSSOLoginSessionUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/GetSSOLoginSessionUseCase.kt index ca3aa6afd6d..b2993786a9a 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/GetSSOLoginSessionUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/GetSSOLoginSessionUseCase.kt @@ -26,7 +26,7 @@ import com.wire.kalium.logic.data.id.IdMapper import com.wire.kalium.logic.data.session.SessionMapper import com.wire.kalium.logic.data.user.SsoId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.auth.AccountTokens +import com.wire.kalium.logic.data.auth.AccountTokens import com.wire.kalium.logic.functional.fold import com.wire.kalium.network.exceptions.KaliumException import io.ktor.http.HttpStatusCode diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/BackupScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/BackupScope.kt index 46d1841100e..813d46fbedb 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/BackupScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/BackupScope.kt @@ -21,7 +21,7 @@ import com.wire.kalium.logic.data.asset.KaliumFileSystem import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository import com.wire.kalium.logic.di.UserStorage -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.message.PersistMigratedMessagesUseCase import com.wire.kalium.logic.sync.slow.RestartSlowSyncProcessForRecoveryUseCase import com.wire.kalium.logic.util.SecurityHelperImpl diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/CreateBackupUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/CreateBackupUseCase.kt index 6f2e2d0682f..5edd002ef32 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/CreateBackupUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/CreateBackupUseCase.kt @@ -29,7 +29,7 @@ import com.wire.kalium.logic.data.id.IdMapper import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.backup.BackupConstants.BACKUP_ENCRYPTED_FILE_NAME import com.wire.kalium.logic.feature.backup.BackupConstants.BACKUP_METADATA_FILE_NAME import com.wire.kalium.logic.feature.backup.BackupConstants.BACKUP_USER_DB_NAME diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupUseCase.kt index eddba8bb6ca..1183ad06047 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupUseCase.kt @@ -29,7 +29,7 @@ import com.wire.kalium.logic.data.id.IdMapper import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.backup.BackupConstants.BACKUP_ENCRYPTED_EXTENSION import com.wire.kalium.logic.feature.backup.BackupConstants.createBackupFileName import com.wire.kalium.logic.feature.backup.RestoreBackupResult.BackupRestoreFailure.BackupIOFailure @@ -51,7 +51,6 @@ import com.wire.kalium.util.KaliumDispatcher import com.wire.kalium.util.KaliumDispatcherImpl import kotlinx.coroutines.withContext import kotlinx.serialization.SerializationException -import kotlinx.serialization.decodeFromString import okio.Path import okio.Source import okio.buffer diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/CallsScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/CallsScope.kt index e6ccbe57e16..46da890c277 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/CallsScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/CallsScope.kt @@ -27,7 +27,7 @@ import com.wire.kalium.logic.data.call.ParticipantsOrderByNameImpl import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.data.id.QualifiedIdMapper import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.call.usecase.AnswerCallUseCase import com.wire.kalium.logic.feature.call.usecase.AnswerCallUseCaseImpl import com.wire.kalium.logic.feature.call.usecase.ConversationClientsInCallUpdater diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt index a8f2bda8f84..a8fe41268c1 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/GlobalCallManager.kt @@ -28,7 +28,7 @@ import com.wire.kalium.logic.data.id.QualifiedID import com.wire.kalium.logic.data.id.QualifiedIdMapper import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.call.usecase.ConversationClientsInCallUpdater import com.wire.kalium.logic.feature.message.MessageSender import com.wire.kalium.logic.featureFlags.KaliumConfigs diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/AnswerCallUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/AnswerCallUseCase.kt index 578704ae52d..f141ad6843a 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/AnswerCallUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/AnswerCallUseCase.kt @@ -20,7 +20,7 @@ package com.wire.kalium.logic.feature.call.usecase import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.feature.call.CallManager -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import com.wire.kalium.logic.featureFlags.KaliumConfigs import com.wire.kalium.util.KaliumDispatcher import com.wire.kalium.util.KaliumDispatcherImpl diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallUseCase.kt index a71edf000a6..4a40f083ce1 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallUseCase.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.feature.call.CallManager -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import com.wire.kalium.util.KaliumDispatcher import com.wire.kalium.util.KaliumDispatcherImpl import kotlinx.coroutines.flow.first diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/GetAllCallsWithSortedParticipantsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/GetAllCallsWithSortedParticipantsUseCase.kt index 62b12702f64..6245734aec6 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/GetAllCallsWithSortedParticipantsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/GetAllCallsWithSortedParticipantsUseCase.kt @@ -20,7 +20,7 @@ package com.wire.kalium.logic.feature.call.usecase import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.call.CallingParticipantsOrder -import com.wire.kalium.logic.feature.call.Call +import com.wire.kalium.logic.data.call.Call import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/GetIncomingCallsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/GetIncomingCallsUseCase.kt index f5333988282..b415906f322 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/GetIncomingCallsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/GetIncomingCallsUseCase.kt @@ -26,7 +26,7 @@ import com.wire.kalium.logic.data.conversation.MutedConversationStatus import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.user.UserAvailabilityStatus import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.call.Call +import com.wire.kalium.logic.data.call.Call import com.wire.kalium.logic.functional.nullableFold import com.wire.kalium.logic.kaliumLogger import kotlinx.coroutines.ExperimentalCoroutinesApi diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/IsCallRunningUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/IsCallRunningUseCase.kt index 69fdadfa8a2..8616788c4aa 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/IsCallRunningUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/IsCallRunningUseCase.kt @@ -19,7 +19,7 @@ package com.wire.kalium.logic.feature.call.usecase import com.wire.kalium.logic.data.call.CallRepository -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import com.wire.kalium.logic.feature.call.usecase.IsCallRunningUseCase.Companion.runningCalls import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.map diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/ObserveEstablishedCallsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/ObserveEstablishedCallsUseCase.kt index eaf85defb02..eccfe475a0f 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/ObserveEstablishedCallsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/ObserveEstablishedCallsUseCase.kt @@ -19,7 +19,7 @@ package com.wire.kalium.logic.feature.call.usecase import com.wire.kalium.logic.data.call.CallRepository -import com.wire.kalium.logic.feature.call.Call +import com.wire.kalium.logic.data.call.Call import kotlinx.coroutines.flow.Flow /** diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/ObserveOngoingCallsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/ObserveOngoingCallsUseCase.kt index c78257f15bf..8784db0065f 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/ObserveOngoingCallsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/ObserveOngoingCallsUseCase.kt @@ -19,7 +19,7 @@ package com.wire.kalium.logic.feature.call.usecase import com.wire.kalium.logic.data.call.CallRepository -import com.wire.kalium.logic.feature.call.Call +import com.wire.kalium.logic.data.call.Call import kotlinx.coroutines.flow.Flow /** diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/RejectCallUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/RejectCallUseCase.kt index 3b2e5ade365..a77ca49dbbb 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/RejectCallUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/call/usecase/RejectCallUseCase.kt @@ -22,7 +22,7 @@ import com.wire.kalium.logic.callingLogger import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.feature.call.CallManager -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import com.wire.kalium.util.KaliumDispatcher import com.wire.kalium.util.KaliumDispatcherImpl import kotlinx.coroutines.withContext diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClearClientDataUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClearClientDataUseCase.kt index db3172ae66d..af4489fd11e 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClearClientDataUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClearClientDataUseCase.kt @@ -20,7 +20,7 @@ package com.wire.kalium.logic.feature.client import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.client.MLSClientProvider -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.onFailure diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCase.kt index 3cae85e397a..91158e022ac 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCase.kt @@ -26,7 +26,7 @@ import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.id.toCrypto import com.wire.kalium.logic.data.prekey.PreKeyRepository import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.fold diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientScope.kt index bff8c3a512b..face58d064b 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ClientScope.kt @@ -35,8 +35,8 @@ import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository import com.wire.kalium.logic.feature.CachedClientIdClearer -import com.wire.kalium.logic.feature.CurrentClientIdProvider -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider import com.wire.kalium.logic.feature.keypackage.MLSKeyPackageCountUseCase import com.wire.kalium.logic.feature.keypackage.MLSKeyPackageCountUseCaseImpl import com.wire.kalium.logic.feature.keypackage.RefillKeyPackagesUseCase diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/FetchSelfClientsFromRemoteUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/FetchSelfClientsFromRemoteUseCase.kt index 01332723835..f5730b333e6 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/FetchSelfClientsFromRemoteUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/FetchSelfClientsFromRemoteUseCase.kt @@ -22,7 +22,7 @@ import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.client.Client import com.wire.kalium.logic.data.client.ClientRepository import com.wire.kalium.logic.data.conversation.ClientId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.fold import com.wire.kalium.logic.functional.getOrNull diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/MLSClientManager.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/MLSClientManager.kt index 9f6f50d261e..7221dc3d089 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/MLSClientManager.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/MLSClientManager.kt @@ -22,7 +22,7 @@ import com.wire.kalium.logic.data.client.ClientRepository import com.wire.kalium.logic.data.sync.IncrementalSyncRepository import com.wire.kalium.logic.data.sync.IncrementalSyncStatus import com.wire.kalium.logic.data.sync.SlowSyncRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.onSuccess diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/NeedsToRegisterClientUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/NeedsToRegisterClientUseCase.kt index 889a1e0f1d3..7015787020a 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/NeedsToRegisterClientUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/NeedsToRegisterClientUseCase.kt @@ -20,9 +20,9 @@ package com.wire.kalium.logic.feature.client import com.wire.kalium.logic.data.session.SessionRepository import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider -import com.wire.kalium.logic.feature.ProteusClientProvider -import com.wire.kalium.logic.feature.auth.AccountInfo +import com.wire.kalium.logic.data.id.CurrentClientIdProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider +import com.wire.kalium.logic.data.auth.AccountInfo import com.wire.kalium.logic.functional.fold /** diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ObserveClientDetailsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ObserveClientDetailsUseCase.kt index 0768cf810e4..5b6e9996aa7 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ObserveClientDetailsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/client/ObserveClientDetailsUseCase.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.data.client.Client import com.wire.kalium.logic.data.client.ClientRepository import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.fold import com.wire.kalium.logic.functional.getOrNull import kotlinx.coroutines.flow.Flow diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ClearConversationContentUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ClearConversationContentUseCase.kt index 63c24c21b97..fa04c8934c2 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ClearConversationContentUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ClearConversationContentUseCase.kt @@ -25,7 +25,7 @@ import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.message.Message import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.message.MessageSender import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.fold diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ConversationScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ConversationScope.kt index c33785dca71..fe8f47ec6aa 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ConversationScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/ConversationScope.kt @@ -32,15 +32,15 @@ import com.wire.kalium.logic.data.conversation.TypingIndicatorOutgoingRepository import com.wire.kalium.logic.data.conversation.TypingIndicatorSenderHandler import com.wire.kalium.logic.data.conversation.TypingIndicatorSenderHandlerImpl import com.wire.kalium.logic.data.conversation.UpdateKeyingMaterialThresholdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.data.id.QualifiedIdMapper +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.data.message.PersistMessageUseCase import com.wire.kalium.logic.data.properties.UserPropertyRepository import com.wire.kalium.logic.data.team.TeamRepository import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository import com.wire.kalium.logic.di.UserStorage -import com.wire.kalium.logic.feature.CurrentClientIdProvider -import com.wire.kalium.logic.feature.SelfTeamIdProvider import com.wire.kalium.logic.feature.connection.MarkConnectionRequestAsNotifiedUseCase import com.wire.kalium.logic.feature.connection.MarkConnectionRequestAsNotifiedUseCaseImpl import com.wire.kalium.logic.feature.connection.ObserveConnectionListUseCase @@ -147,7 +147,7 @@ class ConversationScope internal constructor( internal val newGroupConversationSystemMessagesCreator: NewGroupConversationSystemMessagesCreator get() = NewGroupConversationSystemMessagesCreatorImpl( persistMessage, - isSelfATeamMember, + selfTeamIdProvider, qualifiedIdMapper, selfUserId ) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/CreateGroupConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/CreateGroupConversationUseCase.kt index d4613c342a1..65328dafab7 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/CreateGroupConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/CreateGroupConversationUseCase.kt @@ -26,7 +26,7 @@ import com.wire.kalium.logic.data.conversation.ConversationOptions import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.data.conversation.NewGroupConversationSystemMessagesCreator import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.conversation.CreateGroupConversationUseCase.Result import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.fold diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RecoverMLSConversationsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RecoverMLSConversationsUseCase.kt index ff61f78481b..8805ce939a3 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RecoverMLSConversationsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RecoverMLSConversationsUseCase.kt @@ -23,6 +23,7 @@ import com.wire.kalium.logic.data.client.ClientRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.conversation.Conversation.ProtocolInfo.MLSCapable.GroupState import com.wire.kalium.logic.data.conversation.ConversationRepository +import com.wire.kalium.logic.data.conversation.JoinExistingMLSConversationUseCase import com.wire.kalium.logic.data.conversation.MLSConversationRepository import com.wire.kalium.logic.featureFlags.FeatureSupport import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationReadDateUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationReadDateUseCase.kt index 4fc2cfa85e7..470f6f27ab5 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationReadDateUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/UpdateConversationReadDateUseCase.kt @@ -26,7 +26,7 @@ import com.wire.kalium.logic.data.id.QualifiedID import com.wire.kalium.logic.data.message.Message import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.message.MessageSender import com.wire.kalium.logic.feature.message.SendConfirmationUseCase import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/mls/MLSOneOnOneConversationResolver.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/mls/MLSOneOnOneConversationResolver.kt index 55bfea4e331..2c3f2fe1556 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/mls/MLSOneOnOneConversationResolver.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/mls/MLSOneOnOneConversationResolver.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.data.conversation.Conversation.ProtocolInfo.MLSCapa import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.conversation.JoinExistingMLSConversationUseCase +import com.wire.kalium.logic.data.conversation.JoinExistingMLSConversationUseCase import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.map diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/BreakSessionUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/BreakSessionUseCase.kt index f5a9f92d286..e152d176adc 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/BreakSessionUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/BreakSessionUseCase.kt @@ -25,7 +25,7 @@ import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.id.IdMapper import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider import com.wire.kalium.logic.functional.fold import com.wire.kalium.logic.kaliumLogger import com.wire.kalium.util.KaliumDispatcher diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/DebugScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/DebugScope.kt index 84891a1c98c..af321f5dac4 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/DebugScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/DebugScope.kt @@ -31,8 +31,8 @@ import com.wire.kalium.logic.data.prekey.PreKeyRepository import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider import com.wire.kalium.logic.feature.message.MLSMessageCreator import com.wire.kalium.logic.feature.message.MLSMessageCreatorImpl import com.wire.kalium.logic.feature.message.MessageEnvelopeCreator @@ -44,8 +44,8 @@ import com.wire.kalium.logic.feature.message.MessageSenderImpl import com.wire.kalium.logic.feature.message.MessageSendingInterceptor import com.wire.kalium.logic.feature.message.MessageSendingInterceptorImpl import com.wire.kalium.logic.feature.message.MessageSendingScheduler -import com.wire.kalium.logic.feature.message.SessionEstablisher -import com.wire.kalium.logic.feature.message.SessionEstablisherImpl +import com.wire.kalium.logic.data.message.SessionEstablisher +import com.wire.kalium.logic.data.message.SessionEstablisherImpl import com.wire.kalium.logic.feature.message.StaleEpochVerifier import com.wire.kalium.logic.feature.message.ephemeral.DeleteEphemeralMessageForSelfUserAsReceiverUseCaseImpl import com.wire.kalium.logic.feature.message.ephemeral.DeleteEphemeralMessageForSelfUserAsSenderUseCaseImpl diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/SendBrokenAssetMessageUseCaseImpl.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/SendBrokenAssetMessageUseCaseImpl.kt index 5cb30a6fad9..3f255b8d3c1 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/SendBrokenAssetMessageUseCaseImpl.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/SendBrokenAssetMessageUseCaseImpl.kt @@ -34,7 +34,7 @@ import com.wire.kalium.logic.data.message.MessageEncryptionAlgorithm import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.message.MessageSender import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/SendConfirmationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/SendConfirmationUseCase.kt index 2e542ebfd91..a660d63c20f 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/SendConfirmationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/debug/SendConfirmationUseCase.kt @@ -27,7 +27,7 @@ import com.wire.kalium.logic.data.message.receipt.ReceiptType import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.message.MessageSender import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/featureConfig/handler/SelfDeletingMessagesConfigHandler.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/featureConfig/handler/SelfDeletingMessagesConfigHandler.kt index 0cc1ddf7585..0e4886f090c 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/featureConfig/handler/SelfDeletingMessagesConfigHandler.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/featureConfig/handler/SelfDeletingMessagesConfigHandler.kt @@ -21,8 +21,8 @@ import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.configuration.UserConfigRepository import com.wire.kalium.logic.data.featureConfig.SelfDeletingMessagesModel import com.wire.kalium.logic.data.featureConfig.Status -import com.wire.kalium.logic.feature.selfDeletingMessages.TeamSelfDeleteTimer -import com.wire.kalium.logic.feature.selfDeletingMessages.TeamSettingsSelfDeletionStatus +import com.wire.kalium.logic.data.message.TeamSelfDeleteTimer +import com.wire.kalium.logic.data.message.TeamSettingsSelfDeletionStatus import com.wire.kalium.logic.featureFlags.KaliumConfigs import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.fold diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/MLSKeyPackageCountUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/MLSKeyPackageCountUseCase.kt index 96eb524d3d6..c6dab182820 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/MLSKeyPackageCountUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/MLSKeyPackageCountUseCase.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.NetworkFailure import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.keypackage.KeyPackageLimitsProvider import com.wire.kalium.logic.data.keypackage.KeyPackageRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.fold /** diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCase.kt index 20fde717108..16da5f44aed 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCase.kt @@ -21,7 +21,7 @@ package com.wire.kalium.logic.feature.keypackage import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.keypackage.KeyPackageLimitsProvider import com.wire.kalium.logic.data.keypackage.KeyPackageRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.fold diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/DeleteMessageUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/DeleteMessageUseCase.kt index b13c6dff097..da819c70928 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/DeleteMessageUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/DeleteMessageUseCase.kt @@ -31,7 +31,7 @@ import com.wire.kalium.logic.data.message.MessageRepository import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.foldToEitherWhileRight diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageEnvelopeCreator.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageEnvelopeCreator.kt index 2b580c3a258..dba290a00c0 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageEnvelopeCreator.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageEnvelopeCreator.kt @@ -42,7 +42,7 @@ import com.wire.kalium.logic.data.message.ProtoContentMapper import com.wire.kalium.logic.data.message.RecipientEntry import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.kaliumLogger diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageScope.kt index 800b735e1b9..c6a95cded49 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageScope.kt @@ -38,8 +38,10 @@ import com.wire.kalium.logic.data.properties.UserPropertyRepository import com.wire.kalium.logic.data.sync.IncrementalSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider +import com.wire.kalium.logic.data.message.SessionEstablisher +import com.wire.kalium.logic.data.message.SessionEstablisherImpl import com.wire.kalium.logic.feature.asset.GetMessageAssetUseCase import com.wire.kalium.logic.feature.asset.GetMessageAssetUseCaseImpl import com.wire.kalium.logic.feature.asset.ScheduleNewAssetMessageUseCase diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageSender.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageSender.kt index a600b61a123..9df54219c9e 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageSender.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageSender.kt @@ -31,11 +31,15 @@ import com.wire.kalium.logic.data.conversation.Recipient import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.GroupID import com.wire.kalium.logic.data.message.BroadcastMessage +import com.wire.kalium.logic.data.message.BroadcastMessageOption +import com.wire.kalium.logic.data.message.BroadcastMessageTarget import com.wire.kalium.logic.data.message.Message import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.message.MessageEnvelope import com.wire.kalium.logic.data.message.MessageRepository import com.wire.kalium.logic.data.message.MessageSent +import com.wire.kalium.logic.data.message.MessageTarget +import com.wire.kalium.logic.data.message.SessionEstablisher import com.wire.kalium.logic.data.message.getType import com.wire.kalium.logic.data.prekey.UsersWithoutSessions import com.wire.kalium.logic.data.user.UserId diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendConfirmationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendConfirmationUseCase.kt index 9c8c79821f9..50e5dc279b5 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendConfirmationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendConfirmationUseCase.kt @@ -31,7 +31,7 @@ import com.wire.kalium.logic.data.message.MessageRepository import com.wire.kalium.logic.data.message.receipt.ReceiptType import com.wire.kalium.logic.data.properties.UserPropertyRepository import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.fold diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendEditTextMessageUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendEditTextMessageUseCase.kt index c25c5a2fe06..41c3289bcd4 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendEditTextMessageUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendEditTextMessageUseCase.kt @@ -28,7 +28,7 @@ import com.wire.kalium.logic.data.message.MessageRepository import com.wire.kalium.logic.data.message.mention.MessageMention import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.onFailure diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendKnockUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendKnockUseCase.kt index cad936ee85e..2be19264233 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendKnockUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendKnockUseCase.kt @@ -27,7 +27,7 @@ import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.message.PersistMessageUseCase import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.selfDeletingMessages.ObserveSelfDeletionTimerSettingsForConversationUseCase import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendTextMessageUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendTextMessageUseCase.kt index 85fcc688e31..40fdc376a97 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendTextMessageUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendTextMessageUseCase.kt @@ -29,7 +29,7 @@ import com.wire.kalium.logic.data.message.mention.MessageMention import com.wire.kalium.logic.data.properties.UserPropertyRepository import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.selfDeletingMessages.ObserveSelfDeletionTimerSettingsForConversationUseCase import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SessionResetSender.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SessionResetSender.kt index 9316ec216cc..de7401b29fe 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SessionResetSender.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SessionResetSender.kt @@ -29,7 +29,8 @@ import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider +import com.wire.kalium.logic.data.message.MessageTarget import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.util.DateTimeUtil diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/StaleEpochVerifier.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/StaleEpochVerifier.kt index fe82c98852e..250a29b293a 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/StaleEpochVerifier.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/StaleEpochVerifier.kt @@ -25,7 +25,7 @@ import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.data.conversation.MLSConversationRepository import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.message.SystemMessageInserter -import com.wire.kalium.logic.feature.conversation.JoinExistingMLSConversationUseCase +import com.wire.kalium.logic.data.conversation.JoinExistingMLSConversationUseCase import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.map diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/ToggleReactionUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/ToggleReactionUseCase.kt index b49daf5cc31..dae2ed1b963 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/ToggleReactionUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/ToggleReactionUseCase.kt @@ -29,7 +29,7 @@ import com.wire.kalium.logic.data.message.reaction.ReactionRepository import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.flatMapLeft diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/composite/SendButtonActionMessageUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/composite/SendButtonActionMessageUseCase.kt index 7c18c2a2e42..492c479b7b8 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/composite/SendButtonActionMessageUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/composite/SendButtonActionMessageUseCase.kt @@ -24,9 +24,9 @@ import com.wire.kalium.logic.data.message.Message import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.message.MessageMetadataRepository import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.message.MessageSender -import com.wire.kalium.logic.feature.message.MessageTarget +import com.wire.kalium.logic.data.message.MessageTarget import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.fold import com.wire.kalium.logic.sync.SyncManager diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/ephemeral/DeleteEphemeralMessageForSelfUserAsReceiverUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/ephemeral/DeleteEphemeralMessageForSelfUserAsReceiverUseCase.kt index bcbbf287eaf..a3f57d8900c 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/ephemeral/DeleteEphemeralMessageForSelfUserAsReceiverUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/ephemeral/DeleteEphemeralMessageForSelfUserAsReceiverUseCase.kt @@ -28,9 +28,9 @@ import com.wire.kalium.logic.data.message.Message import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.message.MessageRepository import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.message.MessageSender -import com.wire.kalium.logic.feature.message.MessageTarget +import com.wire.kalium.logic.data.message.MessageTarget import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.foldToEitherWhileRight diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/mlsmigration/MLSMigrator.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/mlsmigration/MLSMigrator.kt index 272cffa6c9c..73115f245db 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/mlsmigration/MLSMigrator.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/mlsmigration/MLSMigrator.kt @@ -27,7 +27,7 @@ import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.message.SystemMessageInserter import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.flatMapLeft diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/RegisterAccountUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/RegisterAccountUseCase.kt index b3de31c9763..c58d0db0572 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/RegisterAccountUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/register/RegisterAccountUseCase.kt @@ -25,7 +25,7 @@ import com.wire.kalium.logic.configuration.server.ServerConfig import com.wire.kalium.logic.data.auth.login.ProxyCredentials import com.wire.kalium.logic.data.register.RegisterAccountRepository import com.wire.kalium.logic.data.user.SsoId -import com.wire.kalium.logic.feature.auth.AccountTokens +import com.wire.kalium.logic.data.auth.AccountTokens import com.wire.kalium.logic.functional.fold import com.wire.kalium.logic.functional.map import com.wire.kalium.network.exceptions.KaliumException diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/ObserveSelfDeletionTimerSettingsForConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/ObserveSelfDeletionTimerSettingsForConversationUseCase.kt index 710c8511bf7..1a09142bb09 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/ObserveSelfDeletionTimerSettingsForConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/ObserveSelfDeletionTimerSettingsForConversationUseCase.kt @@ -22,6 +22,8 @@ import com.wire.kalium.logic.configuration.UserConfigRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.data.id.ConversationId +import com.wire.kalium.logic.data.message.SelfDeletionTimer +import com.wire.kalium.logic.data.message.TeamSelfDeleteTimer import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.fold import com.wire.kalium.logic.util.isPositiveNotNull diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/ObserveTeamSettingsSelfDeletingStatusUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/ObserveTeamSettingsSelfDeletingStatusUseCase.kt index 82712d7e2dc..d1ae0ee782e 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/ObserveTeamSettingsSelfDeletingStatusUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/ObserveTeamSettingsSelfDeletingStatusUseCase.kt @@ -18,6 +18,8 @@ package com.wire.kalium.logic.feature.selfDeletingMessages import com.wire.kalium.logic.configuration.UserConfigRepository +import com.wire.kalium.logic.data.message.TeamSelfDeleteTimer +import com.wire.kalium.logic.data.message.TeamSettingsSelfDeletionStatus import com.wire.kalium.logic.functional.fold import com.wire.kalium.logic.kaliumLogger import kotlinx.coroutines.flow.Flow diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/PersistNewSelfDeletionTimerUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/PersistNewSelfDeletionTimerUseCase.kt index 7afd34668c1..7078b705216 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/PersistNewSelfDeletionTimerUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/PersistNewSelfDeletionTimerUseCase.kt @@ -19,6 +19,7 @@ package com.wire.kalium.logic.feature.selfDeletingMessages import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.data.id.ConversationId +import com.wire.kalium.logic.data.message.SelfDeletionTimer import com.wire.kalium.logic.functional.fold import com.wire.kalium.logic.kaliumLogger import com.wire.kalium.util.serialization.toJsonElement diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/service/ObserveAllServicesUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/service/ObserveAllServicesUseCase.kt index bc2e2ca2c39..ad5705cb218 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/service/ObserveAllServicesUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/service/ObserveAllServicesUseCase.kt @@ -20,7 +20,7 @@ package com.wire.kalium.logic.feature.service import com.wire.kalium.logic.data.service.ServiceDetails import com.wire.kalium.logic.data.service.ServiceRepository import com.wire.kalium.logic.data.team.TeamRepository -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.functional.fold import com.wire.kalium.logic.functional.getOrNull import kotlinx.coroutines.CoroutineScope diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/service/ServiceScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/service/ServiceScope.kt index 922d4ee897f..d06f26f0f62 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/service/ServiceScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/service/ServiceScope.kt @@ -19,7 +19,7 @@ package com.wire.kalium.logic.feature.service import com.wire.kalium.logic.data.service.ServiceRepository import com.wire.kalium.logic.data.team.TeamRepository -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider class ServiceScope internal constructor( private val serviceRepository: ServiceRepository, diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionUseCase.kt index 3ddc3ae3cec..7b993f0945c 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionUseCase.kt @@ -21,7 +21,7 @@ package com.wire.kalium.logic.feature.session import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.data.session.SessionRepository -import com.wire.kalium.logic.feature.auth.AccountInfo +import com.wire.kalium.logic.data.auth.AccountInfo import com.wire.kalium.logic.functional.fold sealed class CurrentSessionResult { diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/SessionResult.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/SessionResult.kt index 1d2f0620797..84221bdc8fb 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/SessionResult.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/SessionResult.kt @@ -19,7 +19,7 @@ package com.wire.kalium.logic.feature.session import com.wire.kalium.logic.CoreFailure -import com.wire.kalium.logic.feature.auth.AccountInfo +import com.wire.kalium.logic.data.auth.AccountInfo sealed class GetAllSessionsResult { class Success(val sessions: List) : GetAllSessionsResult() diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/token/AccessTokenRefresher.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/token/AccessTokenRefresher.kt index 14257f5f408..931d25d0a47 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/token/AccessTokenRefresher.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/token/AccessTokenRefresher.kt @@ -20,7 +20,7 @@ package com.wire.kalium.logic.feature.session.token import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.session.token.AccessTokenRepository import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.auth.AccountTokens +import com.wire.kalium.logic.data.auth.AccountTokens import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.map diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/sessionreset/ResetSessionUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/sessionreset/ResetSessionUseCase.kt index 78e4c4f16c3..93ca7d6fbb3 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/sessionreset/ResetSessionUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/sessionreset/ResetSessionUseCase.kt @@ -27,7 +27,7 @@ import com.wire.kalium.logic.data.id.IdMapper import com.wire.kalium.logic.data.message.MessageRepository import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider import com.wire.kalium.logic.feature.message.SessionResetSender import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.fold diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/team/DeleteTeamConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/team/DeleteTeamConversationUseCase.kt index 6b0feb7cec3..b42dc967aa8 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/team/DeleteTeamConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/team/DeleteTeamConversationUseCase.kt @@ -22,7 +22,7 @@ import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.team.TeamRepository -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.fold import com.wire.kalium.logic.functional.map diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/team/TeamScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/team/TeamScope.kt index bce63ecba86..c0fc5e57d31 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/team/TeamScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/team/TeamScope.kt @@ -21,7 +21,7 @@ package com.wire.kalium.logic.feature.team import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.data.team.TeamRepository import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.feature.user.IsSelfATeamMemberUseCase import com.wire.kalium.logic.feature.user.IsSelfATeamMemberUseCaseImpl diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/IsSelfATeamMemberUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/IsSelfATeamMemberUseCase.kt index 54f343376d3..0a5053f6ae5 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/IsSelfATeamMemberUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/IsSelfATeamMemberUseCase.kt @@ -18,7 +18,7 @@ package com.wire.kalium.logic.feature.user -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.functional.fold /** diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateSelfAvailabilityStatusUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateSelfAvailabilityStatusUseCase.kt index 05a7ab5444b..2b180a71c09 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateSelfAvailabilityStatusUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UpdateSelfAvailabilityStatusUseCase.kt @@ -25,8 +25,8 @@ import com.wire.kalium.logic.data.message.Message import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.user.AccountRepository import com.wire.kalium.logic.data.user.UserAvailabilityStatus -import com.wire.kalium.logic.feature.CurrentClientIdProvider -import com.wire.kalium.logic.feature.message.BroadcastMessageTarget +import com.wire.kalium.logic.data.id.CurrentClientIdProvider +import com.wire.kalium.logic.data.message.BroadcastMessageTarget import com.wire.kalium.logic.feature.message.MessageSender import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.util.DateTimeUtil diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UserScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UserScope.kt index a053164dcc0..b739c686cd5 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UserScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UserScope.kt @@ -31,7 +31,7 @@ import com.wire.kalium.logic.data.team.TeamRepository import com.wire.kalium.logic.data.user.AccountRepository import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.TimestampKeyRepositoryImpl import com.wire.kalium.logic.feature.asset.DeleteAssetUseCase import com.wire.kalium.logic.feature.asset.DeleteAssetUseCaseImpl diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/screenshotCensoring/ObserveScreenshotCensoringConfigUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/screenshotCensoring/ObserveScreenshotCensoringConfigUseCase.kt index 79b02782a92..d305617e0e4 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/screenshotCensoring/ObserveScreenshotCensoringConfigUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/screenshotCensoring/ObserveScreenshotCensoringConfigUseCase.kt @@ -19,7 +19,7 @@ package com.wire.kalium.logic.feature.user.screenshotCensoring import com.wire.kalium.logic.configuration.UserConfigRepository -import com.wire.kalium.logic.feature.selfDeletingMessages.TeamSelfDeleteTimer +import com.wire.kalium.logic.data.message.TeamSelfDeleteTimer import com.wire.kalium.logic.functional.mapRight import com.wire.kalium.logic.functional.mapToRightOr import kotlinx.coroutines.flow.Flow diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/webSocketStatus/ObservePersistentWebSocketConnectionStatusUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/webSocketStatus/ObservePersistentWebSocketConnectionStatusUseCase.kt index 7cb301c1713..3cacb3c12dc 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/webSocketStatus/ObservePersistentWebSocketConnectionStatusUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/webSocketStatus/ObservePersistentWebSocketConnectionStatusUseCase.kt @@ -21,7 +21,7 @@ package com.wire.kalium.logic.feature.user.webSocketStatus import com.wire.kalium.logger.KaliumLogger import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.session.SessionRepository -import com.wire.kalium.logic.feature.auth.PersistentWebSocketStatus +import com.wire.kalium.logic.data.auth.PersistentWebSocketStatus import com.wire.kalium.logic.functional.fold import com.wire.kalium.logic.kaliumLogger import kotlinx.coroutines.flow.Flow diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/network/ApiMigrationV3.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/network/ApiMigrationV3.kt index 15ecbb55ad2..b8becca6990 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/network/ApiMigrationV3.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/network/ApiMigrationV3.kt @@ -20,7 +20,7 @@ package com.wire.kalium.logic.network import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.StorageFailure -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.session.UpgradeCurrentSessionUseCase import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/UserEventReceiver.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/UserEventReceiver.kt index e9d6dfa7f20..6844dee0612 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/UserEventReceiver.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/UserEventReceiver.kt @@ -31,7 +31,7 @@ import com.wire.kalium.logic.data.logout.LogoutReason import com.wire.kalium.logic.data.user.ConnectionState import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.auth.LogoutUseCase import com.wire.kalium.logic.feature.conversation.mls.OneOnOneResolver import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/NewConversationEventHandler.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/NewConversationEventHandler.kt index 8dc1fbf0f14..035a3a6965e 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/NewConversationEventHandler.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/NewConversationEventHandler.kt @@ -26,7 +26,7 @@ import com.wire.kalium.logic.data.event.logEventProcessing import com.wire.kalium.logic.data.id.toDao import com.wire.kalium.logic.data.id.toModel import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.getOrNull diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/ProteusMessageUnpacker.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/ProteusMessageUnpacker.kt index d76c865761d..4f4c3a9b369 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/ProteusMessageUnpacker.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/ProteusMessageUnpacker.kt @@ -34,7 +34,7 @@ import com.wire.kalium.logic.data.message.ProtoContent import com.wire.kalium.logic.data.message.ProtoContentMapper import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMap import com.wire.kalium.logic.functional.map diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/slow/SlowSyncWorker.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/slow/SlowSyncWorker.kt index 279f3a2a56f..57687d3c67c 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/slow/SlowSyncWorker.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/sync/slow/SlowSyncWorker.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.event.EventRepository import com.wire.kalium.logic.data.sync.SlowSyncStep import com.wire.kalium.logic.feature.connection.SyncConnectionsUseCase -import com.wire.kalium.logic.feature.conversation.JoinExistingMLSConversationsUseCase +import com.wire.kalium.logic.data.conversation.JoinExistingMLSConversationsUseCase import com.wire.kalium.logic.feature.conversation.SyncConversationsUseCase import com.wire.kalium.logic.feature.conversation.mls.OneOnOneResolver import com.wire.kalium.logic.feature.featureConfig.SyncFeatureConfigsUseCase diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/call/CallMapperTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/call/CallMapperTest.kt index c950a967e5c..ba7ed0795d5 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/call/CallMapperTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/call/CallMapperTest.kt @@ -28,8 +28,7 @@ import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.conversation.Recipient import com.wire.kalium.logic.data.id.QualifiedIdMapper import com.wire.kalium.logic.data.id.QualifiedIdMapperImpl -import com.wire.kalium.logic.feature.call.CallStatus -import com.wire.kalium.logic.feature.message.MessageTarget +import com.wire.kalium.logic.data.message.MessageTarget import com.wire.kalium.logic.framework.TestCall import com.wire.kalium.persistence.dao.call.CallEntity import kotlinx.coroutines.test.runTest diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/call/CallRepositoryTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/call/CallRepositoryTest.kt index 615d1279689..e27581afb16 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/call/CallRepositoryTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/call/CallRepositoryTest.kt @@ -45,10 +45,8 @@ import com.wire.kalium.logic.data.team.TeamRepository import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository import com.wire.kalium.logic.data.user.type.UserType -import com.wire.kalium.logic.feature.call.Call -import com.wire.kalium.logic.feature.call.CallStatus -import com.wire.kalium.logic.feature.conversation.JoinSubconversationUseCase -import com.wire.kalium.logic.feature.conversation.LeaveSubconversationUseCase +import com.wire.kalium.logic.data.conversation.JoinSubconversationUseCase +import com.wire.kalium.logic.data.conversation.LeaveSubconversationUseCase import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestTeam import com.wire.kalium.logic.framework.TestUser @@ -83,7 +81,6 @@ import kotlinx.coroutines.test.advanceUntilIdle import kotlinx.coroutines.test.runTest import kotlinx.coroutines.yield import kotlinx.datetime.Clock -import kotlinx.datetime.Instant import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertFalse diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/call/CallingParticipantsOrderTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/call/CallingParticipantsOrderTest.kt index 5770464e60c..26c463f9705 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/call/CallingParticipantsOrderTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/call/CallingParticipantsOrderTest.kt @@ -25,7 +25,7 @@ import com.wire.kalium.logic.data.user.ConnectionState import com.wire.kalium.logic.data.user.SelfUser import com.wire.kalium.logic.data.user.UserAvailabilityStatus import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import io.mockative.Mock import io.mockative.any diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/connection/ConnectionRepositoryTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/connection/ConnectionRepositoryTest.kt index 38436932738..387c45b29aa 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/connection/ConnectionRepositoryTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/connection/ConnectionRepositoryTest.kt @@ -24,7 +24,7 @@ import com.wire.kalium.logic.data.id.TeamId import com.wire.kalium.logic.data.id.toDao import com.wire.kalium.logic.data.user.ConnectionState import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either @@ -44,13 +44,9 @@ import com.wire.kalium.network.api.base.model.UserProfileDTO import com.wire.kalium.network.exceptions.KaliumException import com.wire.kalium.network.utils.NetworkResponse import com.wire.kalium.persistence.dao.ConnectionDAO -import com.wire.kalium.persistence.dao.ConnectionEntity import com.wire.kalium.persistence.dao.QualifiedIDEntity -import com.wire.kalium.persistence.dao.UserAvailabilityStatusEntity import com.wire.kalium.persistence.dao.UserDAO -import com.wire.kalium.persistence.dao.UserEntity import com.wire.kalium.persistence.dao.UserIDEntity -import com.wire.kalium.persistence.dao.UserTypeEntity import com.wire.kalium.persistence.dao.conversation.ConversationDAO import com.wire.kalium.util.time.UNIX_FIRST_DATE import io.mockative.Mock diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationGroupRepositoryTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationGroupRepositoryTest.kt index 49259cfa470..ad1ec0543d9 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationGroupRepositoryTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationGroupRepositoryTest.kt @@ -27,8 +27,7 @@ import com.wire.kalium.logic.data.id.toApi import com.wire.kalium.logic.data.id.toModel import com.wire.kalium.logic.data.service.ServiceId import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.SelfTeamIdProvider -import com.wire.kalium.logic.feature.conversation.JoinExistingMLSConversationUseCase +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestConversation.ADD_MEMBER_TO_CONVERSATION_SUCCESSFUL_RESPONSE import com.wire.kalium.logic.framework.TestUser diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepositoryTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepositoryTest.kt index bc77d380f8e..317307b74e7 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepositoryTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepositoryTest.kt @@ -37,7 +37,7 @@ import com.wire.kalium.logic.data.user.SelfUser import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestTeam import com.wire.kalium.logic.framework.TestUser diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/NewGroupConversationSystemMessagesCreatorTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/NewGroupConversationSystemMessagesCreatorTest.kt index 5a6f1c6c614..1944bddcc35 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/NewGroupConversationSystemMessagesCreatorTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/NewGroupConversationSystemMessagesCreatorTest.kt @@ -18,13 +18,14 @@ package com.wire.kalium.logic.data.conversation import com.wire.kalium.logic.data.id.QualifiedIdMapper +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.data.id.toApi import com.wire.kalium.logic.data.id.toDao import com.wire.kalium.logic.data.id.toModel import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.message.PersistMessageUseCase -import com.wire.kalium.logic.feature.user.IsSelfATeamMemberUseCase import com.wire.kalium.logic.framework.TestConversation +import com.wire.kalium.logic.framework.TestTeam import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.util.shouldSucceed @@ -368,7 +369,7 @@ class NewGroupConversationSystemMessagesCreatorTest { val persistMessage = mock(PersistMessageUseCase::class) @Mock - val isSelfATeamMember = mock(IsSelfATeamMemberUseCase::class) + val selfTeamIdProvider = mock(SelfTeamIdProvider::class) @Mock val qualifiedIdMapper = mock(QualifiedIdMapper::class) @@ -387,16 +388,15 @@ class NewGroupConversationSystemMessagesCreatorTest { .then { Either.Right(Unit) } } - fun withIsASelfTeamMember(isMember: Boolean = true) = apply { - given(isSelfATeamMember) - .suspendFunction(isSelfATeamMember::invoke) - .whenInvoked() - .then { isMember } + suspend fun withIsASelfTeamMember(isMember: Boolean = true) = apply { + given(selfTeamIdProvider) + .coroutine { invoke() } + .then { if (isMember) Either.Right(TestTeam.TEAM_ID) else Either.Right(null) } } fun arrange() = this to NewGroupConversationSystemMessagesCreatorImpl( persistMessage, - isSelfATeamMember, + selfTeamIdProvider, qualifiedIdMapper, TestUser.SELF.id, ) diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/e2ei/E2EIRepositoryTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/e2ei/E2EIRepositoryTest.kt index acb0e0a0e5b..f77af398547 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/e2ei/E2EIRepositoryTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/e2ei/E2EIRepositoryTest.kt @@ -28,7 +28,7 @@ import com.wire.kalium.logic.data.e2ei.E2EIRepositoryTest.Arrangement.Companion. import com.wire.kalium.logic.data.e2ei.E2EIRepositoryTest.Arrangement.Companion.RANDOM_NONCE import com.wire.kalium.logic.data.e2ei.E2EIRepositoryTest.Arrangement.Companion.RANDOM_URL import com.wire.kalium.logic.data.e2ei.E2EIRepositoryTest.Arrangement.Companion.TEST_FAILURE -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.util.shouldFail diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/event/EventRepositoryTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/event/EventRepositoryTest.kt index 8a29d9c3974..148709e3f19 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/event/EventRepositoryTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/event/EventRepositoryTest.kt @@ -21,7 +21,7 @@ package com.wire.kalium.logic.data.event import app.cash.turbine.test import com.wire.kalium.logic.NetworkFailure import com.wire.kalium.logic.data.conversation.ClientId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestUser diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/keypackage/KeyPackageRepositoryTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/keypackage/KeyPackageRepositoryTest.kt index 180c5bbe25e..0e408de9ddb 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/keypackage/KeyPackageRepositoryTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/keypackage/KeyPackageRepositoryTest.kt @@ -25,7 +25,7 @@ import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.id.PlainId import com.wire.kalium.logic.data.id.toApi import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.util.shouldFail import com.wire.kalium.logic.util.shouldSucceed diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/message/MessageRepositoryTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/message/MessageRepositoryTest.kt index a761309bb16..a2385c598c8 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/message/MessageRepositoryTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/message/MessageRepositoryTest.kt @@ -28,8 +28,6 @@ import com.wire.kalium.logic.data.id.PersistenceQualifiedId import com.wire.kalium.logic.data.id.toApi import com.wire.kalium.logic.data.id.toDao import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.message.BroadcastMessageOption -import com.wire.kalium.logic.feature.message.MessageTarget import com.wire.kalium.logic.framework.TestMessage.TEST_MESSAGE_ID import com.wire.kalium.logic.framework.TestUser.OTHER_USER_ID_2 import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/message/ephemeral/DeleteEphemeralMessageForSelfUserAsReceiverUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/message/ephemeral/DeleteEphemeralMessageForSelfUserAsReceiverUseCaseTest.kt index 8e50c574e07..6fd84df76ff 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/message/ephemeral/DeleteEphemeralMessageForSelfUserAsReceiverUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/message/ephemeral/DeleteEphemeralMessageForSelfUserAsReceiverUseCaseTest.kt @@ -22,7 +22,7 @@ import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.message.Message import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.message.MessageTarget +import com.wire.kalium.logic.data.message.MessageTarget import com.wire.kalium.logic.feature.message.ephemeral.DeleteEphemeralMessageForSelfUserAsReceiverUseCase import com.wire.kalium.logic.feature.message.ephemeral.DeleteEphemeralMessageForSelfUserAsReceiverUseCaseImpl import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepositoryTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepositoryTest.kt index 097eb40bd90..e73a3a2960d 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepositoryTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/prekey/PreKeyRepositoryTest.kt @@ -28,8 +28,8 @@ import com.wire.kalium.logic.ProteusFailure import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.conversation.Recipient import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/register/RegisterAccountRepositoryTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/register/RegisterAccountRepositoryTest.kt index 766cc79007c..612964daba6 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/register/RegisterAccountRepositoryTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/register/RegisterAccountRepositoryTest.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.data.id.IdMapper import com.wire.kalium.logic.data.session.SessionMapper import com.wire.kalium.logic.data.user.SsoId import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.auth.AccountTokens +import com.wire.kalium.logic.data.auth.AccountTokens import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.test_util.TestNetworkException import com.wire.kalium.network.api.base.model.SelfUserDTO diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/session/SessionMapperTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/session/SessionMapperTest.kt index 170294c5205..0d9be02d497 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/session/SessionMapperTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/session/SessionMapperTest.kt @@ -21,7 +21,7 @@ package com.wire.kalium.logic.data.session import com.wire.kalium.logic.data.id.IdMapper import com.wire.kalium.logic.data.user.SsoId import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.auth.AccountTokens +import com.wire.kalium.logic.data.auth.AccountTokens import com.wire.kalium.network.api.base.model.SessionDTO import com.wire.kalium.persistence.client.AuthTokenEntity import com.wire.kalium.persistence.dao.UserIDEntity diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/user/UserRepositoryTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/user/UserRepositoryTest.kt index 72b3babf23d..4133b36c9c7 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/user/UserRepositoryTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/user/UserRepositoryTest.kt @@ -28,7 +28,7 @@ import com.wire.kalium.logic.data.session.SessionRepository import com.wire.kalium.logic.data.user.UserDataSource.Companion.BATCH_SIZE import com.wire.kalium.logic.data.user.UserDataSource.Companion.SELF_USER_ID_KEY import com.wire.kalium.logic.failure.SelfUserDeleted -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestEvent import com.wire.kalium.logic.framework.TestTeam @@ -50,7 +50,6 @@ import com.wire.kalium.persistence.dao.MetadataDAO import com.wire.kalium.persistence.dao.QualifiedIDEntity import com.wire.kalium.persistence.dao.UserDAO import com.wire.kalium.persistence.dao.UserDetailsEntity -import com.wire.kalium.persistence.dao.UserEntity import com.wire.kalium.persistence.dao.UserIDEntity import com.wire.kalium.persistence.dao.UserTypeEntity import com.wire.kalium.persistence.dao.client.ClientDAO diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCaseTest.kt index aa847d77b3e..dd27fe6cd0b 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCaseTest.kt @@ -35,11 +35,11 @@ import com.wire.kalium.logic.data.message.PersistMessageUseCase import com.wire.kalium.logic.data.properties.UserPropertyRepository import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.message.MessageSendFailureHandler import com.wire.kalium.logic.feature.message.MessageSender import com.wire.kalium.logic.feature.selfDeletingMessages.ObserveSelfDeletionTimerSettingsForConversationUseCase -import com.wire.kalium.logic.feature.selfDeletingMessages.SelfDeletionTimer +import com.wire.kalium.logic.data.message.SelfDeletionTimer import com.wire.kalium.logic.framework.TestAsset.dummyUploadedAssetId import com.wire.kalium.logic.framework.TestAsset.mockedLongAssetData import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/auth/AddAuthenticatedUserUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/auth/AddAuthenticatedUserUseCaseTest.kt index 1cc41898f65..9ba3b9e48d1 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/auth/AddAuthenticatedUserUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/auth/AddAuthenticatedUserUseCaseTest.kt @@ -21,6 +21,9 @@ package com.wire.kalium.logic.feature.auth import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.configuration.server.ServerConfig import com.wire.kalium.logic.configuration.server.ServerConfigRepository +import com.wire.kalium.logic.data.auth.Account +import com.wire.kalium.logic.data.auth.AccountInfo +import com.wire.kalium.logic.data.auth.AccountTokens import com.wire.kalium.logic.data.auth.login.ProxyCredentials import com.wire.kalium.logic.data.session.SessionRepository import com.wire.kalium.logic.data.session.token.AccessToken diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/auth/LoginUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/auth/LoginUseCaseTest.kt index 1cedeb6cd84..9928de2e146 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/auth/LoginUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/auth/LoginUseCaseTest.kt @@ -20,6 +20,7 @@ package com.wire.kalium.logic.feature.auth import com.wire.kalium.logic.NetworkFailure import com.wire.kalium.logic.configuration.server.ServerConfig +import com.wire.kalium.logic.data.auth.AccountTokens import com.wire.kalium.logic.data.auth.login.LoginRepository import com.wire.kalium.logic.data.auth.login.ProxyCredentials import com.wire.kalium.logic.data.auth.verification.FakeSecondFactorVerificationRepository diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/auth/LogoutUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/auth/LogoutUseCaseTest.kt index 5c6af563935..28ed81d2b83 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/auth/LogoutUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/auth/LogoutUseCaseTest.kt @@ -21,6 +21,7 @@ package com.wire.kalium.logic.feature.auth import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.StorageFailure +import com.wire.kalium.logic.data.auth.AccountInfo import com.wire.kalium.logic.data.client.ClientRepository import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.QualifiedID @@ -30,7 +31,7 @@ import com.wire.kalium.logic.data.notification.PushTokenRepository import com.wire.kalium.logic.data.session.SessionRepository import com.wire.kalium.logic.feature.UserSessionScope import com.wire.kalium.logic.feature.UserSessionScopeProvider -import com.wire.kalium.logic.feature.call.Call +import com.wire.kalium.logic.data.call.Call import com.wire.kalium.logic.feature.call.usecase.EndCallUseCase import com.wire.kalium.logic.feature.call.usecase.ObserveEstablishedCallsUseCase import com.wire.kalium.logic.feature.client.ClearClientDataUseCase diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/backup/CreateBackupUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/backup/CreateBackupUseCaseTest.kt index dae9d5e9ba4..1ceadd35c28 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/backup/CreateBackupUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/backup/CreateBackupUseCaseTest.kt @@ -24,7 +24,7 @@ import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.user.SelfUser import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.backup.BackupConstants.BACKUP_ENCRYPTED_FILE_NAME import com.wire.kalium.logic.feature.backup.BackupConstants.BACKUP_METADATA_FILE_NAME import com.wire.kalium.logic.framework.TestUser.SELF diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupUseCaseTest.kt index 459d1d3085a..356ae7e2b6f 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupUseCaseTest.kt @@ -28,7 +28,7 @@ import com.wire.kalium.logic.data.user.SelfUser import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.util.IgnoreIOS diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/AnswerCallUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/AnswerCallUseCaseTest.kt index a947e7e83b8..27dff65bf55 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/AnswerCallUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/AnswerCallUseCaseTest.kt @@ -20,9 +20,9 @@ package com.wire.kalium.logic.feature.call.usecase import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId -import com.wire.kalium.logic.feature.call.Call +import com.wire.kalium.logic.data.call.Call import com.wire.kalium.logic.feature.call.CallManager -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import com.wire.kalium.logic.featureFlags.KaliumConfigs import io.mockative.Mock import io.mockative.classOf diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallOnConversationChangeUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallOnConversationChangeUseCaseTest.kt index 8d7fc1752a4..7138942514c 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallOnConversationChangeUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallOnConversationChangeUseCaseTest.kt @@ -16,8 +16,8 @@ import com.wire.kalium.logic.data.user.UserAssetId import com.wire.kalium.logic.data.user.UserAvailabilityStatus import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.type.UserType -import com.wire.kalium.logic.feature.call.Call -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.Call +import com.wire.kalium.logic.data.call.CallStatus import com.wire.kalium.logic.functional.Either import io.mockative.Mock import io.mockative.classOf diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallUseCaseTest.kt index a0bd4e73fc1..d47c646f438 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/EndCallUseCaseTest.kt @@ -21,9 +21,9 @@ package com.wire.kalium.logic.feature.call.usecase import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId -import com.wire.kalium.logic.feature.call.Call +import com.wire.kalium.logic.data.call.Call import com.wire.kalium.logic.feature.call.CallManager -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import io.mockative.Mock import io.mockative.any import io.mockative.classOf diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/GetAllCallsWithSortedParticipantsUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/GetAllCallsWithSortedParticipantsUseCaseTest.kt index ad76bce278f..7b5fa1deb88 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/GetAllCallsWithSortedParticipantsUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/GetAllCallsWithSortedParticipantsUseCaseTest.kt @@ -23,8 +23,8 @@ import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.call.CallingParticipantsOrder import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId -import com.wire.kalium.logic.feature.call.Call -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.Call +import com.wire.kalium.logic.data.call.CallStatus import io.mockative.Mock import io.mockative.classOf import io.mockative.given diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/GetIncomingCallsUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/GetIncomingCallsUseCaseTest.kt index 220a945253f..d20ee9d9ac2 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/GetIncomingCallsUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/GetIncomingCallsUseCaseTest.kt @@ -27,7 +27,7 @@ import com.wire.kalium.logic.data.conversation.MutedConversationStatus import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.user.UserAvailabilityStatus import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.call.Call +import com.wire.kalium.logic.data.call.Call import com.wire.kalium.logic.framework.TestCall import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestUser diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/IsCallRunningUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/IsCallRunningUseCaseTest.kt index 3f09dcdfa20..b27c68e4699 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/IsCallRunningUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/IsCallRunningUseCaseTest.kt @@ -21,8 +21,8 @@ package com.wire.kalium.logic.feature.call.usecase import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId -import com.wire.kalium.logic.feature.call.Call -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.Call +import com.wire.kalium.logic.data.call.CallStatus import io.mockative.Mock import io.mockative.classOf import io.mockative.given diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/MuteCallUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/MuteCallUseCaseTest.kt index d11284b9293..80eed67a45b 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/MuteCallUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/MuteCallUseCaseTest.kt @@ -21,9 +21,9 @@ package com.wire.kalium.logic.feature.call.usecase import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId -import com.wire.kalium.logic.feature.call.Call +import com.wire.kalium.logic.data.call.Call import com.wire.kalium.logic.feature.call.CallManager -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import io.mockative.Mock import io.mockative.classOf import io.mockative.eq diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/ObserveOngoingCallsUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/ObserveOngoingCallsUseCaseTest.kt index 5a554c84b70..6b9f7dc1e03 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/ObserveOngoingCallsUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/ObserveOngoingCallsUseCaseTest.kt @@ -22,8 +22,8 @@ import app.cash.turbine.test import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId -import com.wire.kalium.logic.feature.call.Call -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.Call +import com.wire.kalium.logic.data.call.CallStatus import io.mockative.Mock import io.mockative.classOf import io.mockative.given diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/RejectCallUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/RejectCallUseCaseTest.kt index 619582c440d..3eb0bbcd232 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/RejectCallUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/RejectCallUseCaseTest.kt @@ -21,7 +21,7 @@ package com.wire.kalium.logic.feature.call.usecase import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.feature.call.CallManager -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import io.mockative.Mock import io.mockative.classOf import io.mockative.eq diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/UnMuteCallUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/UnMuteCallUseCaseTest.kt index 5a891da017d..faf114fbad6 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/UnMuteCallUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/UnMuteCallUseCaseTest.kt @@ -21,9 +21,9 @@ package com.wire.kalium.logic.feature.call.usecase import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId -import com.wire.kalium.logic.feature.call.Call +import com.wire.kalium.logic.data.call.Call import com.wire.kalium.logic.feature.call.CallManager -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import io.mockative.Mock import io.mockative.classOf import io.mockative.eq diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/UpdateConversationClientsForCurrentCallUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/UpdateConversationClientsForCurrentCallUseCaseTest.kt index 29d8b8066ea..8c8d55b1276 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/UpdateConversationClientsForCurrentCallUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/UpdateConversationClientsForCurrentCallUseCaseTest.kt @@ -20,8 +20,8 @@ package com.wire.kalium.logic.feature.call.usecase import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId -import com.wire.kalium.logic.feature.call.Call -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.Call +import com.wire.kalium.logic.data.call.CallStatus import io.mockative.Mock import io.mockative.classOf import io.mockative.eq diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/UpdateVideoStateUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/UpdateVideoStateUseCaseTest.kt index 18849c9fca4..da08ae0d93a 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/UpdateVideoStateUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/call/usecase/UpdateVideoStateUseCaseTest.kt @@ -22,9 +22,9 @@ import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.call.VideoState import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId -import com.wire.kalium.logic.feature.call.Call +import com.wire.kalium.logic.data.call.Call import com.wire.kalium.logic.feature.call.CallManager -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import io.mockative.Mock import io.mockative.any import io.mockative.classOf diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCaseTest.kt index 49230fb0bcf..b71e34572d0 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ClientFingerprintUseCaseTest.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.ProteusFailure import com.wire.kalium.logic.data.prekey.PreKeyRepository import com.wire.kalium.logic.data.prekey.UsersWithoutSessions -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/MLSClientManagerTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/MLSClientManagerTest.kt index 39638999c98..9ff8bb5f996 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/MLSClientManagerTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/MLSClientManagerTest.kt @@ -25,8 +25,7 @@ import com.wire.kalium.logic.data.sync.InMemoryIncrementalSyncRepository import com.wire.kalium.logic.data.sync.IncrementalSyncRepository import com.wire.kalium.logic.data.sync.IncrementalSyncStatus import com.wire.kalium.logic.data.sync.SlowSyncRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider -import com.wire.kalium.logic.feature.user.IsMLSEnabledUseCase +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.test_util.TestKaliumDispatcher diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/NeedsToRegisterClientUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/NeedsToRegisterClientUseCaseTest.kt index 78f46cf32f8..3960372bc66 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/NeedsToRegisterClientUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/NeedsToRegisterClientUseCaseTest.kt @@ -25,9 +25,9 @@ import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.logout.LogoutReason import com.wire.kalium.logic.data.session.SessionRepository import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider -import com.wire.kalium.logic.feature.ProteusClientProvider -import com.wire.kalium.logic.feature.auth.AccountInfo +import com.wire.kalium.logic.data.id.CurrentClientIdProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider +import com.wire.kalium.logic.data.auth.AccountInfo import com.wire.kalium.logic.functional.Either import io.mockative.Mock import io.mockative.any diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ObserveClientDetailsUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ObserveClientDetailsUseCaseTest.kt index 303ded2067a..6af59b8648d 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ObserveClientDetailsUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ObserveClientDetailsUseCaseTest.kt @@ -19,13 +19,10 @@ package com.wire.kalium.logic.feature.client import com.wire.kalium.logic.StorageFailure -import com.wire.kalium.logic.data.client.Client import com.wire.kalium.logic.data.client.ClientRepository -import com.wire.kalium.logic.data.client.ClientType -import com.wire.kalium.logic.data.client.DeviceType import com.wire.kalium.logic.data.id.PlainId import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.test_util.TestKaliumDispatcher @@ -40,7 +37,6 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.first import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.test.runTest -import kotlinx.datetime.Instant import kotlin.test.BeforeTest import kotlin.test.Test import kotlin.test.assertEquals diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ObserveNewClientsUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ObserveNewClientsUseCaseTest.kt index f9a9d14cf63..ca494855fb8 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ObserveNewClientsUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/ObserveNewClientsUseCaseTest.kt @@ -26,7 +26,7 @@ import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.session.SessionRepository import com.wire.kalium.logic.data.team.Team import com.wire.kalium.logic.data.user.SelfUser -import com.wire.kalium.logic.feature.auth.AccountInfo +import com.wire.kalium.logic.data.auth.AccountInfo import com.wire.kalium.logic.feature.user.ObserveValidAccountsUseCase import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.framework.TestUser diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/SelfClientsUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/SelfClientsUseCaseTest.kt index aa178daeb8e..a4f5ca04c67 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/SelfClientsUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/client/SelfClientsUseCaseTest.kt @@ -19,12 +19,9 @@ package com.wire.kalium.logic.feature.client import com.wire.kalium.logic.NetworkFailure -import com.wire.kalium.logic.data.client.Client import com.wire.kalium.logic.data.client.ClientRepository -import com.wire.kalium.logic.data.client.ClientType -import com.wire.kalium.logic.data.client.DeviceType import com.wire.kalium.logic.data.id.PlainId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.functional.Either import com.wire.kalium.network.exceptions.KaliumException diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ClearConversationContentUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ClearConversationContentUseCaseTest.kt index 4fd5e32e608..d01a1a98ac9 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ClearConversationContentUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ClearConversationContentUseCaseTest.kt @@ -22,13 +22,12 @@ import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.cache.SelfConversationIdProvider import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.data.id.ConversationId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.message.MessageSender import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either import io.mockative.Mock -import io.mockative.Times import io.mockative.anything import io.mockative.classOf import io.mockative.given diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/CreateGroupConversationUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/CreateGroupConversationUseCaseTest.kt index db49f9af003..04c2decf411 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/CreateGroupConversationUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/CreateGroupConversationUseCaseTest.kt @@ -27,7 +27,7 @@ import com.wire.kalium.logic.data.conversation.ConversationGroupRepository import com.wire.kalium.logic.data.conversation.ConversationOptions import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.data.conversation.NewGroupConversationSystemMessagesCreator -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCaseTest.kt index 423d54578d1..3a29ea3af78 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationUseCaseTest.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.NetworkFailure import com.wire.kalium.logic.data.client.ClientRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.conversation.ConversationRepository -import com.wire.kalium.logic.data.conversation.DecryptedMessageBundle +import com.wire.kalium.logic.data.conversation.JoinExistingMLSConversationUseCaseImpl import com.wire.kalium.logic.data.conversation.MLSConversationRepository import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.GroupID @@ -50,7 +50,6 @@ import io.mockative.once import io.mockative.twice import io.mockative.verify import kotlinx.coroutines.test.runTest -import kotlinx.datetime.Instant import kotlin.test.Test class JoinExistingMLSConversationUseCaseTest { diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCaseTest.kt index 616404cbe61..be4e0fff8e0 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinExistingMLSConversationsUseCaseTest.kt @@ -21,6 +21,8 @@ package com.wire.kalium.logic.feature.conversation import com.wire.kalium.logic.data.client.ClientRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.conversation.ConversationRepository +import com.wire.kalium.logic.data.conversation.JoinExistingMLSConversationUseCase +import com.wire.kalium.logic.data.conversation.JoinExistingMLSConversationsUseCaseImpl import com.wire.kalium.logic.data.conversation.MLSConversationRepository import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.GroupID @@ -39,7 +41,6 @@ import io.mockative.twice import io.mockative.verify import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest -import kotlinx.datetime.Instant import kotlin.test.Test @OptIn(ExperimentalCoroutinesApi::class) diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinSubconversationUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinSubconversationUseCaseTest.kt index 373ba9f9750..c688010e5c0 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinSubconversationUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/JoinSubconversationUseCaseTest.kt @@ -2,6 +2,7 @@ package com.wire.kalium.logic.feature.conversation import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.NetworkFailure +import com.wire.kalium.logic.data.conversation.JoinSubconversationUseCaseImpl import com.wire.kalium.logic.data.conversation.MLSConversationRepository import com.wire.kalium.logic.data.conversation.SubconversationRepository import com.wire.kalium.logic.data.id.ConversationId diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/LeaveSubconversationUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/LeaveSubconversationUseCaseTest.kt index 093362fa612..df08ff6ed51 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/LeaveSubconversationUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/LeaveSubconversationUseCaseTest.kt @@ -19,13 +19,14 @@ package com.wire.kalium.logic.feature.conversation import com.wire.kalium.cryptography.MLSClient import com.wire.kalium.logic.data.client.MLSClientProvider +import com.wire.kalium.logic.data.conversation.LeaveSubconversationUseCaseImpl import com.wire.kalium.logic.data.conversation.SubconversationRepository import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.GroupID import com.wire.kalium.logic.data.id.SubconversationId import com.wire.kalium.logic.data.id.toApi import com.wire.kalium.logic.data.id.toCrypto -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/RecoverMLSConversationsUseCaseTests.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/RecoverMLSConversationsUseCaseTests.kt index 51abef4ebf7..d6d9aabe072 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/RecoverMLSConversationsUseCaseTests.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/RecoverMLSConversationsUseCaseTests.kt @@ -22,6 +22,7 @@ import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.data.client.ClientRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.conversation.ConversationRepository +import com.wire.kalium.logic.data.conversation.JoinExistingMLSConversationUseCase import com.wire.kalium.logic.data.conversation.MLSConversationRepository import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.GroupID @@ -43,7 +44,6 @@ import io.mockative.twice import io.mockative.verify import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest -import kotlinx.datetime.Instant import kotlin.test.Test import kotlin.test.assertIs diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/featureConfig/SyncFeatureConfigsUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/featureConfig/SyncFeatureConfigsUseCaseTest.kt index 9e4e26b3e4f..7eae5a2597a 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/featureConfig/SyncFeatureConfigsUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/featureConfig/SyncFeatureConfigsUseCaseTest.kt @@ -42,8 +42,8 @@ import com.wire.kalium.logic.feature.featureConfig.handler.MLSConfigHandler import com.wire.kalium.logic.feature.featureConfig.handler.MLSMigrationConfigHandler import com.wire.kalium.logic.feature.featureConfig.handler.SecondFactorPasswordChallengeConfigHandler import com.wire.kalium.logic.feature.featureConfig.handler.SelfDeletingMessagesConfigHandler -import com.wire.kalium.logic.feature.selfDeletingMessages.SelfDeletionMapper.toTeamSelfDeleteTimer -import com.wire.kalium.logic.feature.selfDeletingMessages.TeamSelfDeleteTimer +import com.wire.kalium.logic.data.message.SelfDeletionMapper.toTeamSelfDeleteTimer +import com.wire.kalium.logic.data.message.TeamSelfDeleteTimer import com.wire.kalium.logic.feature.user.UpdateSupportedProtocolsAndResolveOneOnOnesUseCase import com.wire.kalium.logic.featureFlags.BuildFileRestrictionState import com.wire.kalium.logic.featureFlags.KaliumConfigs diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/keypackage/MLSKeyPackageCountUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/keypackage/MLSKeyPackageCountUseCaseTest.kt index 9097103c44a..d88bde4f929 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/keypackage/MLSKeyPackageCountUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/keypackage/MLSKeyPackageCountUseCaseTest.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.NetworkFailure import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.keypackage.KeyPackageLimitsProvider import com.wire.kalium.logic.data.keypackage.KeyPackageRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.keypackage.MLSKeyPackageCountUseCaseTest.Arrangement.Companion.CLIENT_FETCH_ERROR import com.wire.kalium.logic.feature.keypackage.MLSKeyPackageCountUseCaseTest.Arrangement.Companion.KEY_PACKAGE_COUNT import com.wire.kalium.logic.feature.keypackage.MLSKeyPackageCountUseCaseTest.Arrangement.Companion.KEY_PACKAGE_COUNT_DTO diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCaseTest.kt index 4d541403e89..c44163e457b 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/keypackage/RefillKeyPackageUseCaseTest.kt @@ -21,7 +21,7 @@ package com.wire.kalium.logic.feature.keypackage import com.wire.kalium.logic.NetworkFailure import com.wire.kalium.logic.data.keypackage.KeyPackageLimitsProvider import com.wire.kalium.logic.data.keypackage.KeyPackageRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.functional.Either import com.wire.kalium.network.api.base.authenticated.keypackage.KeyPackageCountDTO diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/CryptoSessionMapperTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/CryptoSessionMapperTest.kt index 275e888de02..6cbc0bb5faa 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/CryptoSessionMapperTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/CryptoSessionMapperTest.kt @@ -20,6 +20,8 @@ package com.wire.kalium.logic.feature.message import kotlin.test.Test import com.wire.kalium.cryptography.PreKeyCrypto +import com.wire.kalium.logic.data.message.CryptoSessionMapper +import com.wire.kalium.logic.data.message.CryptoSessionMapperImpl import com.wire.kalium.logic.data.prekey.PreKeyMapperImpl import com.wire.kalium.network.api.base.authenticated.prekey.PreKeyDTO import com.wire.kalium.persistence.dao.QualifiedIDEntity diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/DeleteMessageUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/DeleteMessageUseCaseTest.kt index edb50bbe43f..9c86f8752b7 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/DeleteMessageUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/DeleteMessageUseCaseTest.kt @@ -33,7 +33,7 @@ import com.wire.kalium.logic.data.sync.SlowSyncStatus import com.wire.kalium.logic.data.user.AssetId import com.wire.kalium.logic.data.user.SelfUser import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestMessage import com.wire.kalium.logic.framework.TestUser diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/MessageEnvelopeCreatorTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/MessageEnvelopeCreatorTest.kt index 8a09ed81ace..1cce749afdf 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/MessageEnvelopeCreatorTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/MessageEnvelopeCreatorTest.kt @@ -30,7 +30,7 @@ import com.wire.kalium.logic.data.message.PlainMessageBlob import com.wire.kalium.logic.data.message.ProtoContent import com.wire.kalium.logic.data.message.ProtoContentMapper import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider import com.wire.kalium.logic.framework.TestMessage import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.util.shouldFail diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/MessageSenderTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/MessageSenderTest.kt index 9cd0fcf3e3c..3d96cd596c3 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/MessageSenderTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/MessageSenderTest.kt @@ -28,12 +28,16 @@ import com.wire.kalium.logic.data.conversation.MLSConversationRepository import com.wire.kalium.logic.data.conversation.Recipient import com.wire.kalium.logic.data.id.GroupID import com.wire.kalium.logic.data.message.BroadcastMessage +import com.wire.kalium.logic.data.message.BroadcastMessageOption +import com.wire.kalium.logic.data.message.BroadcastMessageTarget import com.wire.kalium.logic.data.message.Message import com.wire.kalium.logic.data.message.MessageContent import com.wire.kalium.logic.data.message.MessageEnvelope import com.wire.kalium.logic.data.message.MessageRepository import com.wire.kalium.logic.data.message.MessageSent +import com.wire.kalium.logic.data.message.MessageTarget import com.wire.kalium.logic.data.message.RecipientEntry +import com.wire.kalium.logic.data.message.SessionEstablisher import com.wire.kalium.logic.data.prekey.UsersWithoutSessions import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendButtonActionMessageTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendButtonActionMessageTest.kt index 606c3f5f4d1..20df6de902a 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendButtonActionMessageTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendButtonActionMessageTest.kt @@ -20,6 +20,7 @@ package com.wire.kalium.logic.feature.message import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.id.ConversationId +import com.wire.kalium.logic.data.message.MessageTarget import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.feature.message.composite.SendButtonActionMessageUseCase import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendConfirmationUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendConfirmationUseCaseTest.kt index a2363781ef4..92660086aac 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendConfirmationUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendConfirmationUseCaseTest.kt @@ -21,7 +21,7 @@ package com.wire.kalium.logic.feature.message import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.data.message.MessageRepository import com.wire.kalium.logic.data.properties.UserPropertyRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestMessage diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendEditTextMessageUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendEditTextMessageUseCaseTest.kt index 4e3a01757d1..5c46958884f 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendEditTextMessageUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendEditTextMessageUseCaseTest.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.message.MessageRepository import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestUser diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendKnockUserCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendKnockUserCaseTest.kt index caa31719ecf..38f3f253546 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendKnockUserCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendKnockUserCaseTest.kt @@ -25,8 +25,8 @@ import com.wire.kalium.logic.data.message.Message import com.wire.kalium.logic.data.message.PersistMessageUseCase import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus -import com.wire.kalium.logic.feature.CurrentClientIdProvider -import com.wire.kalium.logic.feature.selfDeletingMessages.SelfDeletionTimer +import com.wire.kalium.logic.data.id.CurrentClientIdProvider +import com.wire.kalium.logic.data.message.SelfDeletionTimer import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either @@ -42,7 +42,6 @@ import io.mockative.mock import io.mockative.once import io.mockative.verify import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.flowOf diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendTextMessageCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendTextMessageCaseTest.kt index 64969514fc4..c4c52de7c52 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendTextMessageCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SendTextMessageCaseTest.kt @@ -24,9 +24,9 @@ import com.wire.kalium.logic.data.message.PersistMessageUseCase import com.wire.kalium.logic.data.properties.UserPropertyRepository import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.selfDeletingMessages.ObserveSelfDeletionTimerSettingsForConversationUseCase -import com.wire.kalium.logic.feature.selfDeletingMessages.SelfDeletionTimer +import com.wire.kalium.logic.data.message.SelfDeletionTimer import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestUser diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SessionEstablisherTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SessionEstablisherTest.kt index 9b7544ba6aa..c937f288cd9 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SessionEstablisherTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SessionEstablisherTest.kt @@ -28,7 +28,9 @@ import com.wire.kalium.logic.ProteusFailure import com.wire.kalium.logic.data.conversation.Recipient import com.wire.kalium.logic.data.prekey.PreKeyRepository import com.wire.kalium.logic.data.prekey.UsersWithoutSessions -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider +import com.wire.kalium.logic.data.message.SessionEstablisher +import com.wire.kalium.logic.data.message.SessionEstablisherImpl import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SessionResetSenderTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SessionResetSenderTest.kt index a063609b636..ad51e47e61e 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SessionResetSenderTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/SessionResetSenderTest.kt @@ -21,7 +21,7 @@ package com.wire.kalium.logic.feature.message import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.test_util.TestKaliumDispatcher diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/ToggleReactionUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/ToggleReactionUseCaseTest.kt index f90269a4fc0..f4724a4a425 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/ToggleReactionUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/message/ToggleReactionUseCaseTest.kt @@ -27,7 +27,7 @@ import com.wire.kalium.logic.data.message.reaction.ReactionRepository import com.wire.kalium.logic.data.sync.SlowSyncRepository import com.wire.kalium.logic.data.sync.SlowSyncStatus import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestUser diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/mlsmigration/MLSMigratorTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/mlsmigration/MLSMigratorTest.kt index 290ad13898e..be13196d770 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/mlsmigration/MLSMigratorTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/mlsmigration/MLSMigratorTest.kt @@ -26,7 +26,7 @@ import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.message.SystemMessageInserter import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestTeam import com.wire.kalium.logic.framework.TestUser diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/register/RegisterAccountUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/register/RegisterAccountUseCaseTest.kt index a971645a6e9..18b8bd0101f 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/register/RegisterAccountUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/register/RegisterAccountUseCaseTest.kt @@ -27,7 +27,7 @@ import com.wire.kalium.logic.data.user.SelfUser import com.wire.kalium.logic.data.user.SsoId import com.wire.kalium.logic.data.user.UserAvailabilityStatus import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.auth.AccountTokens +import com.wire.kalium.logic.data.auth.AccountTokens import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.test_util.TestNetworkException import com.wire.kalium.logic.util.stubs.newServerConfig diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/rootDetection/CheckSystemIntegrityUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/rootDetection/CheckSystemIntegrityUseCaseTest.kt index c94375e2eff..855793f9c71 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/rootDetection/CheckSystemIntegrityUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/rootDetection/CheckSystemIntegrityUseCaseTest.kt @@ -19,7 +19,7 @@ package com.wire.kalium.logic.feature.rootDetection import com.wire.kalium.logic.data.logout.LogoutReason import com.wire.kalium.logic.data.session.SessionRepository -import com.wire.kalium.logic.feature.auth.AccountInfo +import com.wire.kalium.logic.data.auth.AccountInfo import com.wire.kalium.logic.featureFlags.KaliumConfigs import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/ObserveSelfDeletingMessagesUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/ObserveSelfDeletingMessagesUseCaseTest.kt index 11fa9d9bd70..a22b45371ee 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/ObserveSelfDeletingMessagesUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/selfDeletingMessages/ObserveSelfDeletingMessagesUseCaseTest.kt @@ -22,6 +22,10 @@ import com.wire.kalium.logic.configuration.UserConfigRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.data.id.ConversationId +import com.wire.kalium.logic.data.message.ConversationSelfDeletionStatus +import com.wire.kalium.logic.data.message.SelfDeletionTimer +import com.wire.kalium.logic.data.message.TeamSelfDeleteTimer +import com.wire.kalium.logic.data.message.TeamSettingsSelfDeletionStatus import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.functional.Either import io.mockative.Mock diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/service/ObserveAllServicesUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/service/ObserveAllServicesUseCaseTest.kt index ed77e97a2cf..b5c7df91a64 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/service/ObserveAllServicesUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/service/ObserveAllServicesUseCaseTest.kt @@ -24,7 +24,7 @@ import com.wire.kalium.logic.data.service.ServiceDetails import com.wire.kalium.logic.data.service.ServiceId import com.wire.kalium.logic.data.service.ServiceRepository import com.wire.kalium.logic.data.team.TeamRepository -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either import io.mockative.Mock diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionFlowUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionFlowUseCaseTest.kt index e34d63bdffc..0276e6e3ac8 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionFlowUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionFlowUseCaseTest.kt @@ -22,7 +22,7 @@ import app.cash.turbine.test import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.data.session.SessionRepository import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.auth.AccountInfo +import com.wire.kalium.logic.data.auth.AccountInfo import com.wire.kalium.logic.functional.Either import io.mockative.Mock import io.mockative.classOf diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionUseCaseTest.kt index 7bacd89fd05..862fa2a81f5 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/session/CurrentSessionUseCaseTest.kt @@ -21,7 +21,7 @@ package com.wire.kalium.logic.feature.session import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.data.session.SessionRepository import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.auth.AccountInfo +import com.wire.kalium.logic.data.auth.AccountInfo import com.wire.kalium.logic.functional.Either import io.mockative.Mock import io.mockative.classOf diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/sessionreset/ResetSessionUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/sessionreset/ResetSessionUseCaseTest.kt index bf692fb39fe..feefe686df8 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/sessionreset/ResetSessionUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/sessionreset/ResetSessionUseCaseTest.kt @@ -23,7 +23,7 @@ import com.wire.kalium.cryptography.ProteusClient import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.id.IdMapper import com.wire.kalium.logic.data.message.MessageRepository -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider import com.wire.kalium.logic.feature.message.SessionResetSender import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/team/DeleteTeamConversationUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/team/DeleteTeamConversationUseCaseTest.kt index 1b90258aa8a..72e0469052a 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/team/DeleteTeamConversationUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/team/DeleteTeamConversationUseCaseTest.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.data.conversation.ConversationRepository import com.wire.kalium.logic.data.id.TeamId import com.wire.kalium.logic.data.team.Team import com.wire.kalium.logic.data.team.TeamRepository -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestTeam import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/user/IsSelfATeamMemberUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/user/IsSelfATeamMemberUseCaseTest.kt index 284b513874c..6abe4ffd78d 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/user/IsSelfATeamMemberUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/user/IsSelfATeamMemberUseCaseTest.kt @@ -20,7 +20,7 @@ package com.wire.kalium.logic.feature.user import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.id.TeamId -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.functional.Either import io.mockative.Mock import io.mockative.given diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/user/screeenshotCensoring/ObserveScreenshotCensoringConfigUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/user/screeenshotCensoring/ObserveScreenshotCensoringConfigUseCaseTest.kt index 90f25187b57..eaa3f9ff87f 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/user/screeenshotCensoring/ObserveScreenshotCensoringConfigUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/user/screeenshotCensoring/ObserveScreenshotCensoringConfigUseCaseTest.kt @@ -21,8 +21,8 @@ package com.wire.kalium.logic.feature.user.screeenshotCensoring import app.cash.turbine.test import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.configuration.UserConfigRepository -import com.wire.kalium.logic.feature.selfDeletingMessages.TeamSelfDeleteTimer -import com.wire.kalium.logic.feature.selfDeletingMessages.TeamSettingsSelfDeletionStatus +import com.wire.kalium.logic.data.message.TeamSelfDeleteTimer +import com.wire.kalium.logic.data.message.TeamSettingsSelfDeletionStatus import com.wire.kalium.logic.feature.user.screenshotCensoring.ObserveScreenshotCensoringConfigResult import com.wire.kalium.logic.feature.user.screenshotCensoring.ObserveScreenshotCensoringConfigUseCaseImpl import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestCall.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestCall.kt index 40bf5e54fab..c393737ab0c 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestCall.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestCall.kt @@ -22,8 +22,8 @@ import com.wire.kalium.logic.data.call.CallMetadata import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.call.Call -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.Call +import com.wire.kalium.logic.data.call.CallStatus import com.wire.kalium.persistence.dao.QualifiedIDEntity import com.wire.kalium.persistence.dao.call.CallEntity import com.wire.kalium.persistence.dao.conversation.ConversationEntity diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/network/ApiMigrationV3Test.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/network/ApiMigrationV3Test.kt index b8a56e20d55..dc8eb0bacc8 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/network/ApiMigrationV3Test.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/network/ApiMigrationV3Test.kt @@ -22,7 +22,7 @@ import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.NetworkFailure import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.data.conversation.ClientId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.session.UpgradeCurrentSessionUseCase import com.wire.kalium.logic.framework.TestClient import com.wire.kalium.logic.functional.Either diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/network/SessionManagerTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/network/SessionManagerTest.kt index 983abb7035e..152c5eef02d 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/network/SessionManagerTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/network/SessionManagerTest.kt @@ -23,7 +23,7 @@ import com.wire.kalium.logic.configuration.server.ServerConfigMapper import com.wire.kalium.logic.data.logout.LogoutReason import com.wire.kalium.logic.data.session.SessionRepository import com.wire.kalium.logic.di.MapperProvider -import com.wire.kalium.logic.feature.auth.AccountTokens +import com.wire.kalium.logic.data.auth.AccountTokens import com.wire.kalium.logic.feature.session.token.AccessTokenRefresher import com.wire.kalium.logic.feature.session.token.AccessTokenRefresherFactory import com.wire.kalium.logic.framework.TestUser diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/FeatureConfigEventReceiverTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/FeatureConfigEventReceiverTest.kt index e7836d14f16..13fc6ebc74a 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/FeatureConfigEventReceiverTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/FeatureConfigEventReceiverTest.kt @@ -37,8 +37,8 @@ import com.wire.kalium.logic.feature.featureConfig.handler.MLSConfigHandler import com.wire.kalium.logic.feature.featureConfig.handler.MLSMigrationConfigHandler import com.wire.kalium.logic.feature.featureConfig.handler.SecondFactorPasswordChallengeConfigHandler import com.wire.kalium.logic.feature.featureConfig.handler.SelfDeletingMessagesConfigHandler -import com.wire.kalium.logic.feature.selfDeletingMessages.TeamSelfDeleteTimer -import com.wire.kalium.logic.feature.selfDeletingMessages.TeamSettingsSelfDeletionStatus +import com.wire.kalium.logic.data.message.TeamSelfDeleteTimer +import com.wire.kalium.logic.data.message.TeamSettingsSelfDeletionStatus import com.wire.kalium.logic.feature.user.UpdateSupportedProtocolsAndResolveOneOnOnesUseCase import com.wire.kalium.logic.featureFlags.KaliumConfigs import com.wire.kalium.logic.framework.TestUser diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/UserEventReceiverTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/UserEventReceiverTest.kt index 3dec042aafe..a24fa4ed765 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/UserEventReceiverTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/UserEventReceiverTest.kt @@ -28,7 +28,7 @@ import com.wire.kalium.logic.data.conversation.NewGroupConversationSystemMessage import com.wire.kalium.logic.data.logout.LogoutReason import com.wire.kalium.logic.data.user.ConnectionState import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.feature.auth.LogoutUseCase import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestEvent diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/NewConversationEventHandlerTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/NewConversationEventHandlerTest.kt index c112debd0a3..e4d4c3151a7 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/NewConversationEventHandlerTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/NewConversationEventHandlerTest.kt @@ -30,7 +30,7 @@ import com.wire.kalium.logic.data.id.toDao import com.wire.kalium.logic.data.id.toModel import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.SelfTeamIdProvider +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestTeam import com.wire.kalium.logic.framework.TestUser diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/ProteusMessageUnpackerTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/ProteusMessageUnpackerTest.kt index 834e6b88b11..f151581ab11 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/ProteusMessageUnpackerTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/receiver/conversation/message/ProteusMessageUnpackerTest.kt @@ -30,11 +30,10 @@ import com.wire.kalium.logic.data.message.PlainMessageBlob import com.wire.kalium.logic.data.message.ProtoContent import com.wire.kalium.logic.data.message.ProtoContentMapper import com.wire.kalium.logic.data.user.UserId -import com.wire.kalium.logic.feature.ProteusClientProvider +import com.wire.kalium.logic.data.client.ProteusClientProvider import com.wire.kalium.logic.framework.TestEvent import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.util.Base64 -import com.wire.kalium.logic.util.IgnoreIOS import com.wire.kalium.logic.util.shouldSucceed import com.wire.kalium.protobuf.encodeToByteArray import com.wire.kalium.protobuf.messages.GenericMessage diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/slow/SlowSyncWorkerTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/slow/SlowSyncWorkerTest.kt index cde7df34b0c..ec6539f5f35 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/slow/SlowSyncWorkerTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/sync/slow/SlowSyncWorkerTest.kt @@ -21,7 +21,7 @@ import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.data.sync.SlowSyncStep import com.wire.kalium.logic.feature.connection.SyncConnectionsUseCase -import com.wire.kalium.logic.feature.conversation.JoinExistingMLSConversationsUseCase +import com.wire.kalium.logic.data.conversation.JoinExistingMLSConversationsUseCase import com.wire.kalium.logic.feature.conversation.SyncConversationsUseCase import com.wire.kalium.logic.feature.conversation.mls.OneOnOneResolver import com.wire.kalium.logic.feature.featureConfig.SyncFeatureConfigsUseCase diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/MessageSenderArrangement.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/MessageSenderArrangement.kt index f5da5cd2563..9eb40ddee39 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/MessageSenderArrangement.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/MessageSenderArrangement.kt @@ -20,7 +20,7 @@ package com.wire.kalium.logic.util.arrangement import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.data.message.Message import com.wire.kalium.logic.feature.message.MessageSender -import com.wire.kalium.logic.feature.message.MessageTarget +import com.wire.kalium.logic.data.message.MessageTarget import com.wire.kalium.logic.functional.Either import io.mockative.Mock import io.mockative.any diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/ObserveSelfDeletionTimerSettingsForConversationUseCaseArrangement.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/ObserveSelfDeletionTimerSettingsForConversationUseCaseArrangement.kt index ef3fea98842..fdaee1064c6 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/ObserveSelfDeletionTimerSettingsForConversationUseCaseArrangement.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/ObserveSelfDeletionTimerSettingsForConversationUseCaseArrangement.kt @@ -19,10 +19,9 @@ package com.wire.kalium.logic.util.arrangement import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.feature.selfDeletingMessages.ObserveSelfDeletionTimerSettingsForConversationUseCase -import com.wire.kalium.logic.feature.selfDeletingMessages.SelfDeletionTimer +import com.wire.kalium.logic.data.message.SelfDeletionTimer import io.mockative.Mock import io.mockative.any -import io.mockative.eq import io.mockative.given import io.mockative.matchers.Matcher import io.mockative.mock diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/provider/CurrentClientIdProviderArrangement.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/provider/CurrentClientIdProviderArrangement.kt index 8b65be951c0..1315ddec00c 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/provider/CurrentClientIdProviderArrangement.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/provider/CurrentClientIdProviderArrangement.kt @@ -20,7 +20,7 @@ package com.wire.kalium.logic.util.arrangement.provider import com.wire.kalium.logic.CoreFailure import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.data.conversation.ClientId -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import io.mockative.Mock import io.mockative.classOf diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/provider/E2EIClientProviderArrangement.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/provider/E2EIClientProviderArrangement.kt index 4e957dc223e..c7186b2f3d7 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/provider/E2EIClientProviderArrangement.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/provider/E2EIClientProviderArrangement.kt @@ -18,12 +18,11 @@ package com.wire.kalium.logic.util.arrangement.provider import com.wire.kalium.cryptography.E2EIClient -import com.wire.kalium.cryptography.E2EIQualifiedClientId import com.wire.kalium.cryptography.MLSClient import com.wire.kalium.logic.data.client.MLSClientProvider import com.wire.kalium.logic.data.user.SelfUser import com.wire.kalium.logic.data.user.UserRepository -import com.wire.kalium.logic.feature.CurrentClientIdProvider +import com.wire.kalium.logic.data.id.CurrentClientIdProvider import com.wire.kalium.logic.functional.Either import io.mockative.Mock import io.mockative.anything diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/usecase/JoinExistingMLSConversationUseCaseArrangement.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/usecase/JoinExistingMLSConversationUseCaseArrangement.kt index 2ea3472d579..d1eafd84a81 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/usecase/JoinExistingMLSConversationUseCaseArrangement.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/util/arrangement/usecase/JoinExistingMLSConversationUseCaseArrangement.kt @@ -18,7 +18,7 @@ package com.wire.kalium.logic.util.arrangement.usecase import com.wire.kalium.logic.CoreFailure -import com.wire.kalium.logic.feature.conversation.JoinExistingMLSConversationUseCase +import com.wire.kalium.logic.data.conversation.JoinExistingMLSConversationUseCase import com.wire.kalium.logic.functional.Either import io.mockative.Mock import io.mockative.any diff --git a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/LayerAccessRulesTest.kt b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/LayerAccessRulesTest.kt index d4f58faa17b..3b356f1e772 100644 --- a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/LayerAccessRulesTest.kt +++ b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/architecture/LayerAccessRulesTest.kt @@ -24,6 +24,12 @@ import kotlin.test.Test class LayerAccessRulesTest { + private companion object { + val importsFromFeatureLayer = ".*?(\\.|)feature(\\..*|\\n)".toRegex() + val importsFromPersistenceLayer = ".*?(\\.|)persistence(\\..*|\\n)".toRegex() + val importsFromNetworkLayer = ".*?(\\.|)network(\\..*|\\n)".toRegex() + } + @Test fun repositoriesShouldNotAccessFeaturePackageClasses() { Konsist.scopeFromProduction() @@ -31,7 +37,7 @@ class LayerAccessRulesTest { .withPackage("com.wire.kalium.logic.data..") .assertFalse { it.hasImport { - it.hasNameContaining("feature") + it.hasNameMatching(importsFromFeatureLayer) } } } @@ -43,7 +49,7 @@ class LayerAccessRulesTest { .withPackage("com.wire.kalium.logic.feature..") .assertFalse { it.hasImport { - it.hasNameContaining("persistence") + it.hasNameMatching(importsFromPersistenceLayer) } } } @@ -55,7 +61,7 @@ class LayerAccessRulesTest { .withPackage("com.wire.kalium.logic.feature..") .assertFalse { it.hasImport { - it.hasNameContaining("network") && !it.hasNameContaining("exception") + it.hasNameMatching(importsFromNetworkLayer) && !it.hasNameContaining("exception") } } } diff --git a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnCloseCallTest.kt b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnCloseCallTest.kt index b4db5d64602..945581b375f 100644 --- a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnCloseCallTest.kt +++ b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnCloseCallTest.kt @@ -26,7 +26,7 @@ import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.GroupID import com.wire.kalium.logic.data.id.QualifiedIdMapperImpl -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.CallStatus import com.wire.kalium.logic.feature.call.scenario.OnCloseCall import com.wire.kalium.logic.framework.TestUser import io.mockative.Mock diff --git a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnHttpRequestTest.kt b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnHttpRequestTest.kt index 6bd0b8bfdb1..9d482a7896b 100644 --- a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnHttpRequestTest.kt +++ b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnHttpRequestTest.kt @@ -24,7 +24,7 @@ import com.wire.kalium.logic.data.conversation.ClientId import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.feature.call.scenario.OnHttpRequest import com.wire.kalium.logic.feature.message.MessageSender -import com.wire.kalium.logic.feature.message.MessageTarget +import com.wire.kalium.logic.data.message.MessageTarget import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either diff --git a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnMuteStateForSelfUserChangedTest.kt b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnMuteStateForSelfUserChangedTest.kt index 1de9ee90559..bbe4326ff96 100644 --- a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnMuteStateForSelfUserChangedTest.kt +++ b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnMuteStateForSelfUserChangedTest.kt @@ -20,8 +20,8 @@ package com.wire.kalium.logic.feature.scenario import com.wire.kalium.logic.data.call.CallRepository import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.id.ConversationId -import com.wire.kalium.logic.feature.call.Call -import com.wire.kalium.logic.feature.call.CallStatus +import com.wire.kalium.logic.data.call.Call +import com.wire.kalium.logic.data.call.CallStatus import com.wire.kalium.logic.feature.call.scenario.OnMuteStateForSelfUserChanged import com.wire.kalium.logic.test_util.TestKaliumDispatcher import io.mockative.Mock diff --git a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnSendOTRTest.kt b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnSendOTRTest.kt index 4394e273ca1..bd8fb4fe6e6 100644 --- a/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnSendOTRTest.kt +++ b/logic/src/jvmTest/kotlin/com/wire/kalium/logic/feature/scenario/OnSendOTRTest.kt @@ -29,7 +29,7 @@ import com.wire.kalium.logic.data.id.QualifiedIdMapperImpl import com.wire.kalium.logic.feature.call.CallManagerImpl import com.wire.kalium.logic.feature.call.scenario.OnSendOTR import com.wire.kalium.logic.feature.message.MessageSender -import com.wire.kalium.logic.feature.message.MessageTarget +import com.wire.kalium.logic.data.message.MessageTarget import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestUser import com.wire.kalium.logic.functional.Either @@ -37,7 +37,6 @@ import com.wire.kalium.logic.test_util.TestKaliumDispatcher import io.mockative.Mock import io.mockative.any import io.mockative.classOf -import io.mockative.eq import io.mockative.given import io.mockative.matching import io.mockative.mock diff --git a/tango-tests/src/integrationTest/kotlin/action/LoginActions.kt b/tango-tests/src/integrationTest/kotlin/action/LoginActions.kt index 1bffb799c83..2a3c103d2b5 100644 --- a/tango-tests/src/integrationTest/kotlin/action/LoginActions.kt +++ b/tango-tests/src/integrationTest/kotlin/action/LoginActions.kt @@ -19,7 +19,7 @@ package action import com.wire.kalium.logic.CoreLogic import com.wire.kalium.logic.feature.auth.AddAuthenticatedUserUseCase -import com.wire.kalium.logic.feature.auth.AccountTokens +import com.wire.kalium.logic.data.auth.AccountTokens import com.wire.kalium.logic.feature.auth.AuthenticationResult import com.wire.kalium.logic.feature.auth.AuthenticationScope import com.wire.kalium.network.api.base.model.SelfUserDTO diff --git a/testservice/src/main/kotlin/com/wire/kalium/testservice/managed/ConversationRepository.kt b/testservice/src/main/kotlin/com/wire/kalium/testservice/managed/ConversationRepository.kt index 8b0401c8399..37a213d3cf1 100644 --- a/testservice/src/main/kotlin/com/wire/kalium/testservice/managed/ConversationRepository.kt +++ b/testservice/src/main/kotlin/com/wire/kalium/testservice/managed/ConversationRepository.kt @@ -27,7 +27,7 @@ import com.wire.kalium.logic.feature.asset.ScheduleNewAssetMessageResult import com.wire.kalium.logic.feature.conversation.ClearConversationContentUseCase import com.wire.kalium.logic.feature.debug.BrokenState import com.wire.kalium.logic.feature.debug.SendBrokenAssetMessageResult -import com.wire.kalium.logic.feature.selfDeletingMessages.SelfDeletionTimer +import com.wire.kalium.logic.data.message.SelfDeletionTimer import com.wire.kalium.logic.feature.session.CurrentSessionResult import com.wire.kalium.logic.functional.fold import com.wire.kalium.logic.functional.onFailure From 13b3a541548ac687e2280275fc9389be3caa49af Mon Sep 17 00:00:00 2001 From: Yamil Medina Date: Tue, 7 Nov 2023 06:14:48 -0300 Subject: [PATCH 9/9] chore: architectural fitness functions - baseline final pt5. (ACOL-123) (#2196) * chore: ignore suppresed baseline of rule * chore: ignore suppresed baseline of rule * chore: ignore suppresed baseline of rule * fix: dependency resolutino * fix: dependency resolution --- logic/build.gradle.kts | 7 +++++-- .../com/wire/kalium/logic/feature/UserSessionScope.kt | 1 + .../kalium/logic/feature/UserSessionScopeProviderImpl.kt | 1 + .../com/wire/kalium/logic/feature/UserSessionScope.kt | 1 + .../kalium/logic/feature/UserSessionScopeProviderImpl.kt | 1 + .../com/wire/kalium/logic/feature/SessionManagerExt.kt | 2 ++ .../wire/kalium/logic/feature/TimestampKeyRepository.kt | 1 + .../com/wire/kalium/logic/feature/UserSessionScope.kt | 1 + .../appVersioning/ObserveIfAppUpdateRequiredUseCase.kt | 1 + .../logic/feature/asset/ScheduleNewAssetMessageUseCase.kt | 1 + .../wire/kalium/logic/feature/auth/AuthenticationScope.kt | 1 + .../kalium/logic/feature/auth/sso/SSOSettingsUseCase.kt | 1 + .../com/wire/kalium/logic/feature/backup/BackupScope.kt | 2 ++ .../kalium/logic/feature/backup/CreateBackupUseCase.kt | 1 + .../kalium/logic/feature/backup/RestoreBackupUseCase.kt | 1 + .../kalium/logic/feature/backup/RestoreWebBackupUseCase.kt | 1 + .../conversation/CheckConversationInviteCodeUseCase.kt | 1 + .../feature/conversation/JoinConversationViaCodeUseCase.kt | 1 + .../conversation/PersistMigratedConversationUseCase.kt | 1 + .../feature/conversation/RenameConversationUseCase.kt | 1 + .../wire/kalium/logic/feature/message/MLSMessageCreator.kt | 1 + .../logic/feature/message/MessageSendFailureHandler.kt | 1 + .../feature/message/PersistMigratedMessagesUseCase.kt | 1 + .../logic/feature/message/RetryFailedMessageUseCase.kt | 2 ++ .../logic/feature/message/SendEditTextMessageUseCase.kt | 1 + .../wire/kalium/logic/feature/migration/MigrationScope.kt | 1 + .../logic/feature/notificationToken/PushTokenUpdater.kt | 1 + .../logic/feature/session/GetProxyCredentialsUseCase.kt | 1 + .../logic/feature/session/UpgradeCurrentSessionUseCase.kt | 1 + .../feature/session/token/AccessTokenRefresherFactory.kt | 2 ++ .../kotlin/com/wire/kalium/logic/feature/user/UserScope.kt | 1 + .../com/wire/kalium/logic/feature/UserSessionScope.kt | 1 + .../kalium/logic/feature/UserSessionScopeProviderImpl.kt | 1 + 33 files changed, 41 insertions(+), 2 deletions(-) diff --git a/logic/build.gradle.kts b/logic/build.gradle.kts index 62cb6566e5a..b5480daeb43 100644 --- a/logic/build.gradle.kts +++ b/logic/build.gradle.kts @@ -78,7 +78,6 @@ kotlin { implementation(libs.mockative.runtime) implementation(libs.okio.test) implementation(libs.settings.kmpTest) - implementation(libs.konsist) } } @@ -100,7 +99,11 @@ kotlin { implementation(libs.bouncy.castle) } } - val jvmTest by getting + val jvmTest by getting { + dependencies { + implementation(libs.konsist) + } + } val androidMain by getting { addCommonKotlinJvmSourceDir() dependencies { diff --git a/logic/src/androidMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt b/logic/src/androidMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt index 886aeb6ed2f..64f75566090 100644 --- a/logic/src/androidMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt +++ b/logic/src/androidMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly", "konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature diff --git a/logic/src/androidMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt b/logic/src/androidMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt index f7b8fdff6e8..a61cb128391 100644 --- a/logic/src/androidMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt +++ b/logic/src/androidMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly", "konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature diff --git a/logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt b/logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt index 1f75e0c897f..182b1dabcf7 100644 --- a/logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt +++ b/logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly", "konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature diff --git a/logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt b/logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt index db3c0c06068..fd85b68fd2b 100644 --- a/logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt +++ b/logic/src/appleMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly", "konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/SessionManagerExt.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/SessionManagerExt.kt index 0690989690e..dbfe45ff4da 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/SessionManagerExt.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/SessionManagerExt.kt @@ -15,6 +15,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessNetworkLayerDirectly") + package com.wire.kalium.logic.feature import com.wire.kalium.logic.data.auth.login.ProxyCredentials diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/TimestampKeyRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/TimestampKeyRepository.kt index ba161051bce..8e781f46a6e 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/TimestampKeyRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/TimestampKeyRepository.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly") package com.wire.kalium.logic.feature diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt index 64dba177165..d79b71fcc3d 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly", "konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/appVersioning/ObserveIfAppUpdateRequiredUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/appVersioning/ObserveIfAppUpdateRequiredUseCase.kt index 6ab438ee1c2..953056eb2cd 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/appVersioning/ObserveIfAppUpdateRequiredUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/appVersioning/ObserveIfAppUpdateRequiredUseCase.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature.appVersioning diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCase.kt index b2c12a2f20d..5e0e70eeb76 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/asset/ScheduleNewAssetMessageUseCase.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly") package com.wire.kalium.logic.feature.asset diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AuthenticationScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AuthenticationScope.kt index 2d4b5783558..474be0e5483 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AuthenticationScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/AuthenticationScope.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature.auth diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/SSOSettingsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/SSOSettingsUseCase.kt index a9eb7148275..409d2d44256 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/SSOSettingsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/auth/sso/SSOSettingsUseCase.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature.auth.sso diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/BackupScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/BackupScope.kt index 813d46fbedb..8f262a0fd5e 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/BackupScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/BackupScope.kt @@ -15,6 +15,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly") + package com.wire.kalium.logic.feature.backup import com.wire.kalium.logic.data.asset.KaliumFileSystem diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/CreateBackupUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/CreateBackupUseCase.kt index 5edd002ef32..4fbc14f86f0 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/CreateBackupUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/CreateBackupUseCase.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly") package com.wire.kalium.logic.feature.backup diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupUseCase.kt index 1183ad06047..08899493709 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreBackupUseCase.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly", "konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature.backup diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreWebBackupUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreWebBackupUseCase.kt index 99af987f549..147dce806e2 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreWebBackupUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/backup/RestoreWebBackupUseCase.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly") package com.wire.kalium.logic.feature.backup diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/CheckConversationInviteCodeUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/CheckConversationInviteCodeUseCase.kt index 2d86ffb9c4f..1307725dbc9 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/CheckConversationInviteCodeUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/CheckConversationInviteCodeUseCase.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature.conversation diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinConversationViaCodeUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinConversationViaCodeUseCase.kt index e613033c75d..1aeca1a4735 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinConversationViaCodeUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/JoinConversationViaCodeUseCase.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature.conversation diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/PersistMigratedConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/PersistMigratedConversationUseCase.kt index fe4dc48c5e4..fe7cb776343 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/PersistMigratedConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/PersistMigratedConversationUseCase.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly") package com.wire.kalium.logic.feature.conversation diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RenameConversationUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RenameConversationUseCase.kt index 28f660f811e..c89486e4408 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RenameConversationUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/conversation/RenameConversationUseCase.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly", "konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature.conversation diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MLSMessageCreator.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MLSMessageCreator.kt index cbd304c06dc..f289533e237 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MLSMessageCreator.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MLSMessageCreator.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature.message diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageSendFailureHandler.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageSendFailureHandler.kt index b0453b4eb62..8140dd5723b 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageSendFailureHandler.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/MessageSendFailureHandler.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly") package com.wire.kalium.logic.feature.message diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/PersistMigratedMessagesUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/PersistMigratedMessagesUseCase.kt index 51f14f25196..a4c2e168e5d 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/PersistMigratedMessagesUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/PersistMigratedMessagesUseCase.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly") package com.wire.kalium.logic.feature.message diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/RetryFailedMessageUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/RetryFailedMessageUseCase.kt index 8c80217b5d4..a3d991264f0 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/RetryFailedMessageUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/RetryFailedMessageUseCase.kt @@ -15,6 +15,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly") + package com.wire.kalium.logic.feature.message import com.benasher44.uuid.uuid4 diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendEditTextMessageUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendEditTextMessageUseCase.kt index 41c3289bcd4..bd7244a5137 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendEditTextMessageUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/message/SendEditTextMessageUseCase.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly") package com.wire.kalium.logic.feature.message diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/migration/MigrationScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/migration/MigrationScope.kt index de4e91eec69..5132fd964a4 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/migration/MigrationScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/migration/MigrationScope.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly") package com.wire.kalium.logic.feature.migration diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/notificationToken/PushTokenUpdater.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/notificationToken/PushTokenUpdater.kt index 9a8dc7770c8..67d1c2314e9 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/notificationToken/PushTokenUpdater.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/notificationToken/PushTokenUpdater.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature.notificationToken diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/GetProxyCredentialsUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/GetProxyCredentialsUseCase.kt index 5027cf59e7e..79127bfe8d5 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/GetProxyCredentialsUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/GetProxyCredentialsUseCase.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature.session diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/UpgradeCurrentSessionUseCase.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/UpgradeCurrentSessionUseCase.kt index c16c88730d7..bf5c1f13707 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/UpgradeCurrentSessionUseCase.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/UpgradeCurrentSessionUseCase.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature.session diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/token/AccessTokenRefresherFactory.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/token/AccessTokenRefresherFactory.kt index 82fe32dee35..749a8f84b31 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/token/AccessTokenRefresherFactory.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/session/token/AccessTokenRefresherFactory.kt @@ -15,6 +15,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly", "konsist.useCasesShouldNotAccessNetworkLayerDirectly") + package com.wire.kalium.logic.feature.session.token import com.wire.kalium.logic.data.session.token.AccessTokenRepositoryImpl diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UserScope.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UserScope.kt index b739c686cd5..c5c065dd6b0 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UserScope.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/feature/user/UserScope.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly") package com.wire.kalium.logic.feature.user diff --git a/logic/src/jvmMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt b/logic/src/jvmMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt index 1f75e0c897f..182b1dabcf7 100644 --- a/logic/src/jvmMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt +++ b/logic/src/jvmMain/kotlin/com/wire/kalium/logic/feature/UserSessionScope.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly", "konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature diff --git a/logic/src/jvmMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt b/logic/src/jvmMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt index 9be3f445628..4b366dc4d7b 100644 --- a/logic/src/jvmMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt +++ b/logic/src/jvmMain/kotlin/com/wire/kalium/logic/feature/UserSessionScopeProviderImpl.kt @@ -15,6 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see http://www.gnu.org/licenses/. */ +@file:Suppress("konsist.useCasesShouldNotAccessDaoLayerDirectly", "konsist.useCasesShouldNotAccessNetworkLayerDirectly") package com.wire.kalium.logic.feature