diff --git a/data/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/Conversation.kt b/data/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/Conversation.kt index 293cf4e6fcb..cb651ca719d 100644 --- a/data/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/Conversation.kt +++ b/data/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/Conversation.kt @@ -299,7 +299,7 @@ sealed class ConversationDetails(open val conversation: Conversation) { override val conversation: Conversation, val hasOngoingCall: Boolean = false, val isSelfUserMember: Boolean, - val isSelfUserCreator: Boolean, + val selfUserTeamId: TeamId?, val selfRole: Conversation.Member.Role? // val isTeamAdmin: Boolean, TODO kubaz ) : ConversationDetails(conversation) diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationMapper.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationMapper.kt index 7a37f8ca9e2..b89f3cf5e78 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationMapper.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationMapper.kt @@ -68,8 +68,11 @@ interface ConversationMapper { fun fromApiModel(mlsPublicKeysDTO: MLSPublicKeysDTO?): MLSPublicKeys? fun fromDaoModel(daoModel: ConversationViewEntity): Conversation fun fromDaoModel(daoModel: ConversationEntity): Conversation - fun fromDaoModelToDetails(daoModel: ConversationViewEntity): ConversationDetails - fun fromDaoModelToDetailsWithEvents(daoModel: ConversationDetailsWithEventsEntity): ConversationDetailsWithEvents + fun fromDaoModelToDetails(daoModel: ConversationViewEntity, selfUserTeamId: TeamId?): ConversationDetails + fun fromDaoModelToDetailsWithEvents( + daoModel: ConversationDetailsWithEventsEntity, + selfUserTeamId: TeamId? + ): ConversationDetailsWithEvents fun fromDaoModel(daoModel: ProposalTimerEntity): ProposalTimer fun toDAOAccess(accessList: Set): List fun toDAOAccessRole(accessRoleList: Set): List @@ -233,7 +236,10 @@ internal class ConversationMapperImpl( } @Suppress("ComplexMethod", "LongMethod") - override fun fromDaoModelToDetails(daoModel: ConversationViewEntity): ConversationDetails = + override fun fromDaoModelToDetails( + daoModel: ConversationViewEntity, + selfUserTeamId: TeamId? + ): ConversationDetails = with(daoModel) { when (type) { ConversationEntity.Type.SELF -> { @@ -271,7 +277,7 @@ internal class ConversationMapperImpl( conversation = fromConversationViewToEntity(daoModel), hasOngoingCall = callStatus != null, // todo: we can do better! isSelfUserMember = isMember, - isSelfUserCreator = isCreator == 1L, + selfUserTeamId = selfUserTeamId, selfRole = selfRole?.let { conversationRoleMapper.fromDAO(it) } ) } @@ -318,9 +324,12 @@ internal class ConversationMapperImpl( } } - override fun fromDaoModelToDetailsWithEvents(daoModel: ConversationDetailsWithEventsEntity): ConversationDetailsWithEvents = - ConversationDetailsWithEvents( - conversationDetails = fromDaoModelToDetails(daoModel.conversationViewEntity), + override fun fromDaoModelToDetailsWithEvents( + daoModel: ConversationDetailsWithEventsEntity, + selfUserTeamId: TeamId? + ): ConversationDetailsWithEvents { + return ConversationDetailsWithEvents( + conversationDetails = fromDaoModelToDetails(daoModel.conversationViewEntity, selfUserTeamId), unreadEventCount = daoModel.unreadEvents.unreadEvents.mapKeys { when (it.key) { UnreadEventTypeEntity.KNOCK -> UnreadEventType.KNOCK @@ -338,6 +347,7 @@ internal class ConversationMapperImpl( }, hasNewActivitiesToShow = daoModel.hasNewActivitiesToShow ) + } override fun fromDaoModel(daoModel: ProposalTimerEntity): ProposalTimer = ProposalTimer(idMapper.fromGroupIDEntity(daoModel.groupID), daoModel.firingDate) 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 f199fe862f7..6c695f304a0 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 @@ -337,8 +337,11 @@ internal class ConversationDataSource internal constructor( private val protocolInfoMapper: ProtocolInfoMapper = MapperProvider.protocolInfoMapper(), private val receiptModeMapper: ReceiptModeMapper = MapperProvider.receiptModeMapper() ) : ConversationRepository { - override val extensions: ConversationRepositoryExtensions = - ConversationRepositoryExtensionsImpl(conversationDAO, conversationMapper) + override val extensions: ConversationRepositoryExtensions = ConversationRepositoryExtensionsImpl( + conversationDAO = conversationDAO, + conversationMapper = conversationMapper, + selfTeamIdProvider = selfTeamIdProvider + ) // region Get/Observe by id @@ -366,7 +369,7 @@ internal class ConversationDataSource internal constructor( .map { eitherConversationView -> eitherConversationView.flatMap { try { - Either.Right(conversationMapper.fromDaoModelToDetails(it)) + Either.Right(conversationMapper.fromDaoModelToDetails(it, selfTeamIdProvider().getOrNull())) } catch (error: IllegalArgumentException) { kaliumLogger.e("require field in conversation Details", error) Either.Left(StorageFailure.DataNotFound) @@ -529,7 +532,9 @@ internal class ConversationDataSource internal constructor( conversationFilter: ConversationFilter ): Flow> = conversationDAO.getAllConversationDetails(fromArchive, conversationFilter.toDao()).map { conversationViewEntityList -> - conversationViewEntityList.map { conversationViewEntity -> conversationMapper.fromDaoModelToDetails(conversationViewEntity) } + conversationViewEntityList.map { conversationViewEntity -> + conversationMapper.fromDaoModelToDetails(conversationViewEntity, selfTeamIdProvider().getOrNull()) + } } override suspend fun observeConversationListDetailsWithEvents( @@ -553,7 +558,8 @@ internal class ConversationDataSource internal constructor( lastMessage = lastMessageMap[conversation.id], messageDraft = messageDraftMap[conversation.id], unreadEvents = unreadEventsMap[conversation.id] ?: ConversationUnreadEventEntity(conversation.id, mapOf()), - ) + ), + selfTeamIdProvider().getOrNull() ) } } @@ -1010,7 +1016,7 @@ internal class ConversationDataSource internal constructor( override suspend fun getConversationDetailsByMLSGroupId(mlsGroupId: GroupID): Either = wrapStorageRequest { conversationDAO.getConversationDetailsByGroupID(mlsGroupId.value) } - .map { conversationMapper.fromDaoModelToDetails(it) } + .map { conversationMapper.fromDaoModelToDetails(it, selfTeamIdProvider().getOrNull()) } override suspend fun observeUnreadArchivedConversationsCount(): Flow = conversationDAO.observeUnreadArchivedConversationsCount() diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepositoryExtensions.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepositoryExtensions.kt index aec18932a97..8ca46260dc7 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepositoryExtensions.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepositoryExtensions.kt @@ -20,6 +20,8 @@ package com.wire.kalium.logic.data.conversation import app.cash.paging.PagingConfig import app.cash.paging.PagingData import app.cash.paging.map +import com.wire.kalium.logic.data.id.SelfTeamIdProvider +import com.wire.kalium.logic.functional.getOrNull import com.wire.kalium.persistence.dao.conversation.ConversationDAO import com.wire.kalium.persistence.dao.conversation.ConversationDetailsWithEventsEntity import com.wire.kalium.persistence.dao.conversation.ConversationExtensions.QueryConfig @@ -37,7 +39,8 @@ interface ConversationRepositoryExtensions { class ConversationRepositoryExtensionsImpl internal constructor( private val conversationDAO: ConversationDAO, - private val conversationMapper: ConversationMapper + private val conversationMapper: ConversationMapper, + private val selfTeamIdProvider: SelfTeamIdProvider ) : ConversationRepositoryExtensions { override suspend fun getPaginatedConversationDetailsWithEventsBySearchQuery( queryConfig: ConversationQueryConfig, @@ -61,7 +64,8 @@ class ConversationRepositoryExtensionsImpl internal constructor( pagingData .map { conversationDetailsWithEventsEntity -> conversationMapper.fromDaoModelToDetailsWithEvents( - conversationDetailsWithEventsEntity + daoModel = conversationDetailsWithEventsEntity, + selfUserTeamId = selfTeamIdProvider().getOrNull() ) } } diff --git a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/folders/ConversationFolderRepository.kt b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/folders/ConversationFolderRepository.kt index caf5173737c..b696725dae4 100644 --- a/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/folders/ConversationFolderRepository.kt +++ b/logic/src/commonMain/kotlin/com/wire/kalium/logic/data/conversation/folders/ConversationFolderRepository.kt @@ -27,9 +27,11 @@ import com.wire.kalium.logic.data.conversation.ConversationMapper import com.wire.kalium.logic.data.conversation.FolderType import com.wire.kalium.logic.data.conversation.FolderWithConversations import com.wire.kalium.logic.data.id.QualifiedID +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.di.MapperProvider import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.flatMapLeft +import com.wire.kalium.logic.functional.getOrNull import com.wire.kalium.logic.functional.map import com.wire.kalium.logic.functional.onFailure import com.wire.kalium.logic.functional.onSuccess @@ -57,6 +59,7 @@ internal class ConversationFolderDataSource internal constructor( private val conversationFolderDAO: ConversationFolderDAO, private val userPropertiesApi: PropertiesApi, private val selfUserId: QualifiedID, + private val selfTeamIdProvider: SelfTeamIdProvider, private val conversationMapper: ConversationMapper = MapperProvider.conversationMapper(selfUserId) ) : ConversationFolderRepository { @@ -72,7 +75,7 @@ internal class ConversationFolderDataSource internal constructor( override suspend fun observeConversationsFromFolder(folderId: String): Flow> = conversationFolderDAO.observeConversationListFromFolder(folderId).map { conversationDetailsWithEventsEntityList -> conversationDetailsWithEventsEntityList.map { - conversationMapper.fromDaoModelToDetailsWithEvents(it) + conversationMapper.fromDaoModelToDetailsWithEvents(it, selfTeamIdProvider().getOrNull()) } } 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 53cf5806b89..a2c3cc6260f 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 @@ -720,9 +720,10 @@ class UserSessionScope internal constructor( private val conversationFolderRepository: ConversationFolderRepository get() = ConversationFolderDataSource( - userStorage.database.conversationFolderDAO, - authenticatedNetworkContainer.propertiesApi, - userId + conversationFolderDAO = userStorage.database.conversationFolderDAO, + userPropertiesApi = authenticatedNetworkContainer.propertiesApi, + selfUserId = userId, + selfTeamIdProvider = selfTeamId ) private val conversationGroupRepository: ConversationGroupRepository 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 1b0b223aa64..a9e87876011 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 @@ -174,7 +174,7 @@ class CallRepositoryTest { Arrangement.groupConversation, false, isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) ) @@ -212,7 +212,7 @@ class CallRepositoryTest { ConversationDetails.Group( Arrangement.groupConversation, isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) ) @@ -266,7 +266,7 @@ class CallRepositoryTest { ConversationDetails.Group( Arrangement.groupConversation, isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) ) @@ -309,7 +309,7 @@ class CallRepositoryTest { ConversationDetails.Group( Arrangement.groupConversation, isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) ) @@ -366,7 +366,7 @@ class CallRepositoryTest { ConversationDetails.Group( Arrangement.groupConversation, isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) ) diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationMapperTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationMapperTest.kt index 8001981da4c..dfc2727a4f8 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationMapperTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationMapperTest.kt @@ -385,7 +385,7 @@ class ConversationMapperTest { messageDraft = messageDraft, unreadEvents = ConversationUnreadEventEntity(TestConversation.VIEW_ENTITY.id, mapOf()), ) - assertion(conversationMapper.fromDaoModelToDetailsWithEvents(conversation).lastMessage) + assertion(conversationMapper.fromDaoModelToDetailsWithEvents(conversation, selfUserTeamId = null).lastMessage) } @Test diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepositoryExtensionsTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepositoryExtensionsTest.kt index dbc66271f5d..bbc3ca0344d 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepositoryExtensionsTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/ConversationRepositoryExtensionsTest.kt @@ -22,6 +22,7 @@ import app.cash.paging.Pager import app.cash.paging.PagingConfig import app.cash.paging.PagingSource import app.cash.paging.PagingState +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.data.message.MessageMapper import com.wire.kalium.logic.framework.TestConversationDetails import com.wire.kalium.logic.framework.TestMessage @@ -90,10 +91,13 @@ class ConversationRepositoryExtensionsTest { @Mock private val conversationMapper: ConversationMapper = mock(ConversationMapper::class) + @Mock + private val selfTeamIdProvider: SelfTeamIdProvider = mock(SelfTeamIdProvider::class) + @Mock private val messageMapper: MessageMapper = mock(MessageMapper::class) private val conversationRepositoryExtensions: ConversationRepositoryExtensions by lazy { - ConversationRepositoryExtensionsImpl(conversationDAO, conversationMapper) + ConversationRepositoryExtensionsImpl(conversationDAO, conversationMapper, selfTeamIdProvider) } init { @@ -101,7 +105,7 @@ class ConversationRepositoryExtensionsTest { messageMapper.fromEntityToMessage(any()) }.returns(TestMessage.TEXT_MESSAGE) every { - conversationMapper.fromDaoModelToDetails(any()) + conversationMapper.fromDaoModelToDetails(any(), any()) }.returns(TestConversationDetails.CONVERSATION_GROUP) every { conversationDAO.platformExtensions diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/folders/ConversationFolderRepositoryTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/folders/ConversationFolderRepositoryTest.kt index 8b830cb30dc..3f673dc61a9 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/folders/ConversationFolderRepositoryTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/data/conversation/folders/ConversationFolderRepositoryTest.kt @@ -20,9 +20,11 @@ package com.wire.kalium.logic.data.conversation.folders import com.wire.kalium.logic.NetworkFailure import com.wire.kalium.logic.data.conversation.FolderType import com.wire.kalium.logic.data.conversation.FolderWithConversations +import com.wire.kalium.logic.data.id.SelfTeamIdProvider import com.wire.kalium.logic.di.MapperProvider import com.wire.kalium.logic.framework.TestConversation import com.wire.kalium.logic.framework.TestUser +import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.util.shouldFail import com.wire.kalium.logic.util.shouldSucceed import com.wire.kalium.network.api.authenticated.properties.LabelListResponseDTO @@ -81,13 +83,17 @@ class ConversationFolderRepositoryTest { val conversations = listOf(conversation) val arrangement = Arrangement().withConversationsFromFolder(folderId, conversations) + .withEmptySelfTeamId() // when val resultFlow = arrangement.repository.observeConversationsFromFolder(folderId) // then val emittedConversations = resultFlow.first() - assertEquals(arrangement.conversationMapper.fromDaoModelToDetailsWithEvents(conversations.first()), emittedConversations.first()) + assertEquals( + arrangement.conversationMapper.fromDaoModelToDetailsWithEvents(conversations.first(), selfUserTeamId = null), + emittedConversations.first() + ) } @Test @@ -163,6 +169,9 @@ class ConversationFolderRepositoryTest { @Mock val userPropertiesApi = mock(PropertiesApi::class) + @Mock + val selfTeamIdProvider = mock(SelfTeamIdProvider::class) + private val selfUserId = TestUser.SELF.id val conversationMapper = MapperProvider.conversationMapper(selfUserId) @@ -170,7 +179,8 @@ class ConversationFolderRepositoryTest { val repository = ConversationFolderDataSource( conversationFolderDAO = conversationFolderDAO, userPropertiesApi = userPropertiesApi, - selfUserId = selfUserId + selfUserId = selfUserId, + selfTeamIdProvider = selfTeamIdProvider ) suspend fun withFavoriteConversationFolder(folder: ConversationFolderEntity): Arrangement { @@ -183,6 +193,11 @@ class ConversationFolderRepositoryTest { return this } + suspend fun withEmptySelfTeamId(): Arrangement { + coEvery { selfTeamIdProvider() }.returns(Either.Right(null)) + return this + } + suspend fun withSuccessfulFolderUpdate(): Arrangement { coEvery { conversationFolderDAO.updateConversationFolders(any()) }.returns(Unit) return this 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 6212866cc8e..991e42c8000 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 @@ -249,7 +249,7 @@ class EndCallOnConversationChangeUseCaseTest { conversation = conversation, hasOngoingCall = true, isSelfUserMember = false, - isSelfUserCreator = false, + selfUserTeamId = null, selfRole = null ) diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ObserveConversationDetailsUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ObserveConversationDetailsUseCaseTest.kt index 3bf203d73db..4d3feb6ca82 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ObserveConversationDetailsUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ObserveConversationDetailsUseCaseTest.kt @@ -81,7 +81,7 @@ class ObserveConversationDetailsUseCaseTest { ConversationDetails.Group( conversation, isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) ), @@ -89,7 +89,7 @@ class ObserveConversationDetailsUseCaseTest { ConversationDetails.Group( conversation.copy(name = "New Name"), isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) ) diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ObserveConversationListDetailsUseCaseTest.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ObserveConversationListDetailsUseCaseTest.kt index e2f9044bf6c..42a6712f1be 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ObserveConversationListDetailsUseCaseTest.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/feature/conversation/ObserveConversationListDetailsUseCaseTest.kt @@ -65,7 +65,7 @@ class ObserveConversationListDetailsUseCaseTest { ConversationDetails.Group( groupConversation, isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) @@ -100,14 +100,14 @@ class ObserveConversationListDetailsUseCaseTest { ConversationDetails.Group( groupConversation1, isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) val groupConversationDetails2 = ConversationDetails.Group( groupConversation2, isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) @@ -141,7 +141,7 @@ class ObserveConversationListDetailsUseCaseTest { val groupConversationDetails = ConversationDetails.Group( conversation = groupConversation, isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) @@ -175,7 +175,7 @@ class ObserveConversationListDetailsUseCaseTest { ConversationDetails.Group( groupConversation, isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) ) @@ -223,7 +223,7 @@ class ObserveConversationListDetailsUseCaseTest { val groupConversationDetails = ConversationDetails.Group( groupConversation, isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) @@ -258,7 +258,7 @@ class ObserveConversationListDetailsUseCaseTest { val groupConversationDetails = ConversationDetails.Group( groupConversation, isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) @@ -287,7 +287,7 @@ class ObserveConversationListDetailsUseCaseTest { val groupConversationDetails = ConversationDetails.Group( groupConversation, isSelfUserMember = true, - isSelfUserCreator = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member ) diff --git a/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestConversationDetails.kt b/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestConversationDetails.kt index 1372c6fc446..fa600880eb0 100644 --- a/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestConversationDetails.kt +++ b/logic/src/commonTest/kotlin/com/wire/kalium/logic/framework/TestConversationDetails.kt @@ -45,8 +45,8 @@ object TestConversationDetails { val CONVERSATION_GROUP = ConversationDetails.Group( conversation = TestConversation.GROUP(), - isSelfUserCreator = true, isSelfUserMember = true, + selfUserTeamId = null, selfRole = Conversation.Member.Role.Member )