diff --git a/app/src/main/kotlin/com/wire/android/di/accountScoped/ConversationModule.kt b/app/src/main/kotlin/com/wire/android/di/accountScoped/ConversationModule.kt index f2d6cfc6a79..a425c1d25fc 100644 --- a/app/src/main/kotlin/com/wire/android/di/accountScoped/ConversationModule.kt +++ b/app/src/main/kotlin/com/wire/android/di/accountScoped/ConversationModule.kt @@ -29,7 +29,7 @@ import com.wire.kalium.logic.feature.conversation.ConversationScope import com.wire.kalium.logic.feature.conversation.CreateGroupConversationUseCase import com.wire.kalium.logic.feature.conversation.GetConversationProtocolInfoUseCase import com.wire.kalium.logic.feature.conversation.GetConversationUnreadEventsCountUseCase -import com.wire.kalium.logic.feature.conversation.GetOneToOneConversationUseCase +import com.wire.kalium.logic.feature.conversation.GetOneToOneConversationDetailsUseCase import com.wire.kalium.logic.feature.conversation.GetOrCreateOneToOneConversationUseCase import com.wire.kalium.logic.feature.conversation.IsOneToOneConversationCreatedUseCase import com.wire.kalium.logic.feature.conversation.JoinConversationViaCodeUseCase @@ -95,7 +95,7 @@ class ConversationModule { @ViewModelScoped @Provides - fun provideObserveConversationUseCase(conversationScope: ConversationScope): GetOneToOneConversationUseCase = + fun provideObserveConversationUseCase(conversationScope: ConversationScope): GetOneToOneConversationDetailsUseCase = conversationScope.getOneToOneConversation @ViewModelScoped diff --git a/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButton.kt b/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButton.kt index a5603942fd8..141856f5a92 100644 --- a/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButton.kt +++ b/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButton.kt @@ -18,6 +18,7 @@ package com.wire.android.ui.connection +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height @@ -66,6 +67,7 @@ fun ConnectionActionButton( fullName: String, connectionStatus: ConnectionState, isConversationStarted: Boolean, + modifier: Modifier = Modifier, onConnectionRequestIgnored: (String) -> Unit = {}, onOpenConversation: (ConversationId) -> Unit = {}, viewModel: ConnectionActionButtonViewModel = @@ -95,43 +97,28 @@ fun ConnectionActionButton( } } - when (connectionStatus) { - ConnectionState.SENT -> WireSecondaryButton( - text = stringResource(R.string.connection_label_cancel_request), - loading = viewModel.actionableState().isPerformingAction, - onClick = viewModel::onCancelConnectionRequest, - clickBlockParams = ClickBlockParams(blockWhenSyncing = true, blockWhenConnecting = true), - modifier = Modifier.testTag(CONNECTION_ACTION_BUTTONS_TEST_TAG), - ) - - ConnectionState.ACCEPTED -> WirePrimaryButton( - text = stringResource(if (isConversationStarted) R.string.label_open_conversation else R.string.label_start_conversation), - loading = viewModel.actionableState().isPerformingAction, - onClick = { - viewModel.onOpenConversation(onOpenConversation) { - unableStartConversationDialogState.show(UnableStartConversationDialogState(fullName)) - } - }, - modifier = Modifier.testTag(CONNECTION_ACTION_BUTTONS_TEST_TAG), - ) + Box(modifier = modifier) { + when (connectionStatus) { + ConnectionState.SENT -> WireSecondaryButton( + text = stringResource(R.string.connection_label_cancel_request), + loading = viewModel.actionableState().isPerformingAction, + onClick = viewModel::onCancelConnectionRequest, + clickBlockParams = ClickBlockParams(blockWhenSyncing = true, blockWhenConnecting = true), + modifier = Modifier.testTag(CONNECTION_ACTION_BUTTONS_TEST_TAG), + ) - ConnectionState.IGNORED -> WirePrimaryButton( - text = stringResource(R.string.connection_label_accept), - loading = viewModel.actionableState().isPerformingAction, - onClick = viewModel::onAcceptConnectionRequest, - clickBlockParams = ClickBlockParams(blockWhenSyncing = true, blockWhenConnecting = true), - leadingIcon = { - Icon( - painter = painterResource(id = R.drawable.ic_check_tick), - contentDescription = null, - modifier = Modifier.padding(dimensions().spacing8x) - ) - }, - modifier = Modifier.testTag(CONNECTION_ACTION_BUTTONS_TEST_TAG), - ) + ConnectionState.ACCEPTED -> WirePrimaryButton( + text = stringResource(if (isConversationStarted) R.string.label_open_conversation else R.string.label_start_conversation), + loading = viewModel.actionableState().isPerformingAction, + onClick = { + viewModel.onOpenConversation(onOpenConversation) { + unableStartConversationDialogState.show(UnableStartConversationDialogState(fullName)) + } + }, + modifier = Modifier.testTag(CONNECTION_ACTION_BUTTONS_TEST_TAG), + ) - ConnectionState.PENDING -> Column { - WirePrimaryButton( + ConnectionState.IGNORED -> WirePrimaryButton( text = stringResource(R.string.connection_label_accept), loading = viewModel.actionableState().isPerformingAction, onClick = viewModel::onAcceptConnectionRequest, @@ -145,20 +132,71 @@ fun ConnectionActionButton( }, modifier = Modifier.testTag(CONNECTION_ACTION_BUTTONS_TEST_TAG), ) - Spacer(modifier = Modifier.height(dimensions().spacing8x)) - WirePrimaryButton( - text = stringResource(R.string.connection_label_ignore), + + ConnectionState.PENDING -> Column { + WirePrimaryButton( + text = stringResource(R.string.connection_label_accept), + loading = viewModel.actionableState().isPerformingAction, + onClick = viewModel::onAcceptConnectionRequest, + clickBlockParams = ClickBlockParams(blockWhenSyncing = true, blockWhenConnecting = true), + leadingIcon = { + Icon( + painter = painterResource(id = R.drawable.ic_check_tick), + contentDescription = null, + modifier = Modifier.padding(dimensions().spacing8x) + ) + }, + modifier = Modifier.testTag(CONNECTION_ACTION_BUTTONS_TEST_TAG), + ) + Spacer(modifier = Modifier.height(dimensions().spacing8x)) + WirePrimaryButton( + text = stringResource(R.string.connection_label_ignore), + loading = viewModel.actionableState().isPerformingAction, + state = WireButtonState.Error, + onClick = { + viewModel.onIgnoreConnectionRequest { + onConnectionRequestIgnored(it) + } + }, + clickBlockParams = ClickBlockParams(blockWhenSyncing = true, blockWhenConnecting = true), + leadingIcon = { + Icon( + painter = painterResource(id = R.drawable.ic_close), + contentDescription = null, + modifier = Modifier.padding(dimensions().spacing8x) + ) + }, + modifier = Modifier.testTag(CONNECTION_ACTION_BUTTONS_TEST_TAG), + ) + } + + ConnectionState.BLOCKED -> { + WireSecondaryButton( + text = stringResource(R.string.user_profile_unblock_user), + loading = viewModel.actionableState().isPerformingAction, + onClick = { + unblockUserDialogState.show( + UnblockUserDialogState( + userId = userId, + userName = userName + ) + ) + }, + clickBlockParams = ClickBlockParams(blockWhenSyncing = true, blockWhenConnecting = true), + modifier = Modifier.testTag(CONNECTION_ACTION_BUTTONS_TEST_TAG), + ) + } + + ConnectionState.NOT_CONNECTED, + ConnectionState.CANCELLED, + ConnectionState.MISSING_LEGALHOLD_CONSENT -> WirePrimaryButton( + text = stringResource(R.string.connection_label_connect), loading = viewModel.actionableState().isPerformingAction, - state = WireButtonState.Error, - onClick = { - viewModel.onIgnoreConnectionRequest { - onConnectionRequestIgnored(it) - } - }, + onClick = viewModel::onSendConnectionRequest, clickBlockParams = ClickBlockParams(blockWhenSyncing = true, blockWhenConnecting = true), leadingIcon = { Icon( - painter = painterResource(id = R.drawable.ic_close), + painter = painterResource(id = R.drawable.ic_add_contact), contentDescription = null, modifier = Modifier.padding(dimensions().spacing8x) ) @@ -166,40 +204,6 @@ fun ConnectionActionButton( modifier = Modifier.testTag(CONNECTION_ACTION_BUTTONS_TEST_TAG), ) } - - ConnectionState.BLOCKED -> { - WireSecondaryButton( - text = stringResource(R.string.user_profile_unblock_user), - loading = viewModel.actionableState().isPerformingAction, - onClick = { - unblockUserDialogState.show( - UnblockUserDialogState( - userId = userId, - userName = userName - ) - ) - }, - clickBlockParams = ClickBlockParams(blockWhenSyncing = true, blockWhenConnecting = true), - modifier = Modifier.testTag(CONNECTION_ACTION_BUTTONS_TEST_TAG), - ) - } - - ConnectionState.NOT_CONNECTED, - ConnectionState.CANCELLED, - ConnectionState.MISSING_LEGALHOLD_CONSENT -> WirePrimaryButton( - text = stringResource(R.string.connection_label_connect), - loading = viewModel.actionableState().isPerformingAction, - onClick = viewModel::onSendConnectionRequest, - clickBlockParams = ClickBlockParams(blockWhenSyncing = true, blockWhenConnecting = true), - leadingIcon = { - Icon( - painter = painterResource(id = R.drawable.ic_add_contact), - contentDescription = null, - modifier = Modifier.padding(dimensions().spacing8x) - ) - }, - modifier = Modifier.testTag(CONNECTION_ACTION_BUTTONS_TEST_TAG), - ) } } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt index 9f4e771e491..5d94933b266 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/details/GroupConversationDetailsScreen.kt @@ -126,9 +126,9 @@ import com.wire.android.ui.theme.wireColorScheme import com.wire.android.ui.theme.wireDimensions import com.wire.android.ui.theme.wireTypography import com.wire.android.util.ui.PreviewMultipleThemes +import com.wire.android.util.ui.SnackBarMessageHandler import com.wire.android.util.ui.UIText import com.wire.kalium.logic.data.conversation.Conversation -import com.wire.kalium.logic.data.conversation.ConversationFolder import com.wire.kalium.logic.data.conversation.MutedConversationStatus import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.GroupID @@ -149,10 +149,6 @@ fun GroupConversationDetailsScreen( conversationFoldersScreenResultRecipient: ResultRecipient, viewModel: GroupConversationDetailsViewModel = hiltViewModel(), - removeConversationFromFolderVM: RemoveConversationFromFolderVM = - hiltViewModelScoped( - RemoveConversationFromFolderArgs - ), ) { val scope = rememberCoroutineScope() val resources = LocalContext.current.resources @@ -264,7 +260,6 @@ fun GroupConversationDetailsScreen( onMoveToFolder = { navigator.navigate(NavigationCommand(ConversationFoldersScreenDestination(it))) }, - removeFromFolder = removeConversationFromFolderVM::removeFromFolder ) val tryAgainSnackBarMessage = stringResource(id = R.string.error_unknown_message) @@ -318,13 +313,16 @@ private fun GroupConversationDetailsContent( isAbandonedOneOnOneConversation: Boolean, onSearchConversationMessagesClick: () -> Unit, onConversationMediaClick: () -> Unit, - removeFromFolder: (conversationId: ConversationId, conversationName: String, folder: ConversationFolder) -> Unit, onMoveToFolder: (ConversationFoldersNavArgs) -> Unit = {}, initialPageIndex: GroupConversationDetailsTabItem = GroupConversationDetailsTabItem.OPTIONS, changeConversationFavoriteStateViewModel: ChangeConversationFavoriteVM = hiltViewModelScoped( ChangeConversationFavoriteStateArgs ), + removeConversationFromFolderVM: RemoveConversationFromFolderVM = + hiltViewModelScoped( + RemoveConversationFromFolderArgs + ), ) { val scope = rememberCoroutineScope() val resources = LocalContext.current.resources @@ -504,7 +502,7 @@ private fun GroupConversationDetailsContent( }, changeFavoriteState = changeConversationFavoriteStateViewModel::changeFavoriteState, moveConversationToFolder = onMoveToFolder, - removeFromFolder = removeFromFolder, + removeFromFolder = removeConversationFromFolderVM::removeFromFolder, updateConversationArchiveStatus = { // Only show the confirmation dialog if the conversation is not archived if (!it.isArchived) { @@ -556,6 +554,14 @@ private fun GroupConversationDetailsContent( VisibilityState(legalHoldSubjectDialogState) { LegalHoldSubjectConversationDialog(legalHoldSubjectDialogState::dismiss) } + + SnackBarMessageHandler(infoMessages = changeConversationFavoriteStateViewModel.infoMessage, onEmitted = { + sheetState.hide() + }) + + SnackBarMessageHandler(infoMessages = removeConversationFromFolderVM.infoMessage, onEmitted = { + sheetState.hide() + }) } @Composable @@ -659,8 +665,7 @@ fun PreviewGroupConversationDetails() { onSearchConversationMessagesClick = {}, onConversationMediaClick = {}, isAbandonedOneOnOneConversation = false, - initialPageIndex = GroupConversationDetailsTabItem.PARTICIPANTS, - removeFromFolder = { _, _, _ -> } + initialPageIndex = GroupConversationDetailsTabItem.PARTICIPANTS ) } } diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt index d050920a4de..e57a28bcd4e 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreen.kt @@ -210,7 +210,9 @@ fun OtherUserProfileScreen( navigateBack = navigator::navigateBack, onConversationMediaClick = onConversationMediaClick, onLegalHoldLearnMoreClick = remember { { legalHoldSubjectDialogState.show(Unit) } }, - onMoveToFolder = null // TODO implement when conversation details will be available in OtherUserProfileScreenViewModel + onMoveToFolder = { + navigator.navigate(NavigationCommand(ConversationFoldersScreenDestination(it))) + } ) LaunchedEffect(Unit) { @@ -266,7 +268,7 @@ fun OtherProfileScreenContent( onConversationMediaClick: () -> Unit = {}, navigateBack: () -> Unit = {}, onLegalHoldLearnMoreClick: () -> Unit = {}, - onMoveToFolder: ((ConversationFoldersNavArgs) -> Unit)? = null, + onMoveToFolder: (ConversationFoldersNavArgs) -> Unit = {}, changeConversationFavoriteViewModel: ChangeConversationFavoriteVM = hiltViewModelScoped( ChangeConversationFavoriteStateArgs @@ -641,8 +643,8 @@ fun ContentFooter( state.fullName, state.connectionState, state.isConversationStarted, - onIgnoreConnectionRequest, - onOpenConversation + onConnectionRequestIgnored = onIgnoreConnectionRequest, + onOpenConversation = onOpenConversation ) } } diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModel.kt index f868c94b1e4..934d0cc23d7 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModel.kt @@ -48,6 +48,7 @@ import com.wire.android.ui.userprofile.other.OtherUserProfileInfoMessageType.Unb import com.wire.android.util.dispatchers.DispatcherProvider import com.wire.android.util.ui.UIText import com.wire.kalium.logic.data.conversation.Conversation +import com.wire.kalium.logic.data.conversation.ConversationDetails import com.wire.kalium.logic.data.conversation.MutedConversationStatus import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.QualifiedID @@ -61,7 +62,7 @@ import com.wire.kalium.logic.feature.connection.UnblockUserUseCase import com.wire.kalium.logic.feature.conversation.ArchiveStatusUpdateResult import com.wire.kalium.logic.feature.conversation.ClearConversationContentUseCase import com.wire.kalium.logic.feature.conversation.ConversationUpdateStatusResult -import com.wire.kalium.logic.feature.conversation.GetOneToOneConversationUseCase +import com.wire.kalium.logic.feature.conversation.GetOneToOneConversationDetailsUseCase import com.wire.kalium.logic.feature.conversation.IsOneToOneConversationCreatedUseCase import com.wire.kalium.logic.feature.conversation.RemoveMemberFromConversationUseCase import com.wire.kalium.logic.feature.conversation.UpdateConversationArchivedStatusUseCase @@ -92,7 +93,7 @@ class OtherUserProfileScreenViewModel @Inject constructor( private val updateConversationMutedStatus: UpdateConversationMutedStatusUseCase, private val blockUser: BlockUserUseCase, private val unblockUser: UnblockUserUseCase, - private val observeOneToOneConversation: GetOneToOneConversationUseCase, + private val observeOneToOneConversation: GetOneToOneConversationDetailsUseCase, private val observeUserInfo: ObserveUserInfoUseCase, private val userTypeMapper: UserTypeMapper, private val observeConversationRoleForUser: ObserveConversationRoleForUserUseCase, @@ -192,8 +193,8 @@ class OtherUserProfileScreenViewModel @Inject constructor( is GetUserInfoResult.Success -> { val conversation = when (oneToOneConversation) { - GetOneToOneConversationUseCase.Result.Failure -> null - is GetOneToOneConversationUseCase.Result.Success -> oneToOneConversation.conversation + GetOneToOneConversationDetailsUseCase.Result.Failure -> null + is GetOneToOneConversationDetailsUseCase.Result.Success -> oneToOneConversation.conversation } updateUserInfoState(userResult, groupInfo, conversation) @@ -374,11 +375,12 @@ class OtherUserProfileScreenViewModel @Inject constructor( private fun updateUserInfoState( userResult: GetUserInfoResult.Success, groupInfo: OtherUserProfileGroupState?, - conversation: Conversation? + conversationDetails: ConversationDetails.OneOne? ) { val otherUser = userResult.otherUser val userAvatarAsset = otherUser.completePicture ?.let { pic -> ImageAsset.UserAvatarAsset(pic) } + val conversation = conversationDetails?.conversation state = state.copy( isDataLoading = false, @@ -417,8 +419,8 @@ class OtherUserProfileScreenViewModel @Inject constructor( mlsVerificationStatus = conversation.mlsVerificationStatus, proteusVerificationStatus = conversation.proteusVerificationStatus, isUnderLegalHold = conversation.legalHoldStatus.showLegalHoldIndicator(), - isFavorite = null, // TODO check if we need to pass isFavorite - folder = null, // TODO check if we need to pass folder + isFavorite = conversationDetails.isFavorite, + folder = conversationDetails.folder, isDeletingConversationLocallyRunning = false ) } diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/bottomsheet/OtherUserProfileBottomSheet.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/bottomsheet/OtherUserProfileBottomSheet.kt index ed7f8c7e6a8..cbeeda46fdc 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/bottomsheet/OtherUserProfileBottomSheet.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/bottomsheet/OtherUserProfileBottomSheet.kt @@ -42,7 +42,7 @@ fun OtherUserProfileBottomSheetContent( closeBottomSheet: () -> Unit, getBottomSheetVisibility: () -> Boolean, removeFromFolder: (conversationId: ConversationId, conversationName: String, folder: ConversationFolder) -> Unit, - onMoveToFolder: ((ConversationFoldersNavArgs) -> Unit)? + onMoveToFolder: (ConversationFoldersNavArgs) -> Unit ) { when (val state = bottomSheetState.bottomSheetContentState) { is BottomSheetContent.Conversation -> { diff --git a/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModelTest.kt index 83ff949e572..de0da24cb54 100644 --- a/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModelTest.kt @@ -27,6 +27,7 @@ import com.wire.android.util.ui.UIText import com.wire.kalium.logic.CoreFailure.Unknown import com.wire.kalium.logic.data.conversation.Conversation import com.wire.kalium.logic.data.conversation.Conversation.Member +import com.wire.kalium.logic.data.conversation.ConversationDetails import com.wire.kalium.logic.data.conversation.MutedConversationStatus import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.TeamId @@ -38,7 +39,7 @@ 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.connection.BlockUserResult -import com.wire.kalium.logic.feature.conversation.GetOneToOneConversationUseCase +import com.wire.kalium.logic.feature.conversation.GetOneToOneConversationDetailsUseCase import com.wire.kalium.logic.feature.conversation.UpdateConversationMemberRoleResult import com.wire.kalium.logic.feature.user.GetUserInfoResult import io.mockk.coVerify @@ -61,7 +62,7 @@ class OtherUserProfileScreenViewModelTest { val expected = OtherUserProfileGroupState("some_name", Member.Role.Member, false, CONVERSATION_ID) val (arrangement, viewModel) = OtherUserProfileViewModelArrangement() .withConversationIdInSavedState(CONVERSATION_ID) - .withGetOneToOneConversation(GetOneToOneConversationUseCase.Result.Success(CONVERSATION)) + .withGetOneToOneConversation(GetOneToOneConversationDetailsUseCase.Result.Success(CONVERSATION_ONE_ONE)) .arrange() // when @@ -196,7 +197,7 @@ class OtherUserProfileScreenViewModelTest { .withUserInfo( GetUserInfoResult.Success(OTHER_USER.copy(connectionStatus = ConnectionState.NOT_CONNECTED), TEAM) ) - .withGetOneToOneConversation(GetOneToOneConversationUseCase.Result.Failure) + .withGetOneToOneConversation(GetOneToOneConversationDetailsUseCase.Result.Failure) .arrange() // then @@ -262,6 +263,7 @@ class OtherUserProfileScreenViewModelTest { supportedProtocols = setOf(SupportedProtocol.PROTEUS) ) val TEAM = Team("some_id", "name", "icon") + val CONVERSATION = Conversation( id = CONVERSATION_ID, name = "some_name", @@ -285,6 +287,13 @@ class OtherUserProfileScreenViewModelTest { proteusVerificationStatus = Conversation.VerificationStatus.NOT_VERIFIED, legalHoldStatus = Conversation.LegalHoldStatus.DISABLED ) + + val CONVERSATION_ONE_ONE = ConversationDetails.OneOne( + CONVERSATION, + OTHER_USER, + UserType.EXTERNAL, + ) + val CONVERSATION_ROLE_DATA = ConversationRoleData( "some_name", Member.Role.Member, diff --git a/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileViewModelArrangement.kt b/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileViewModelArrangement.kt index ca20a129518..0442feec6f1 100644 --- a/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileViewModelArrangement.kt +++ b/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileViewModelArrangement.kt @@ -36,7 +36,7 @@ import com.wire.kalium.logic.feature.connection.BlockUserUseCase import com.wire.kalium.logic.feature.connection.UnblockUserUseCase import com.wire.kalium.logic.feature.conversation.ArchiveStatusUpdateResult import com.wire.kalium.logic.feature.conversation.ClearConversationContentUseCase -import com.wire.kalium.logic.feature.conversation.GetOneToOneConversationUseCase +import com.wire.kalium.logic.feature.conversation.GetOneToOneConversationDetailsUseCase import com.wire.kalium.logic.feature.conversation.IsOneToOneConversationCreatedUseCase import com.wire.kalium.logic.feature.conversation.RemoveMemberFromConversationUseCase import com.wire.kalium.logic.feature.conversation.UpdateConversationArchivedStatusUseCase @@ -60,7 +60,7 @@ internal class OtherUserProfileViewModelArrangement { lateinit var savedStateHandle: SavedStateHandle @MockK - lateinit var getOneToOneConversation: GetOneToOneConversationUseCase + lateinit var getOneToOneConversation: GetOneToOneConversationDetailsUseCase @MockK lateinit var observeUserInfo: ObserveUserInfoUseCase @@ -155,7 +155,7 @@ internal class OtherUserProfileViewModelArrangement { coEvery { updateConversationArchivedStatus(any(), any(), any()) } returns ArchiveStatusUpdateResult.Success every { userTypeMapper.toMembership(any()) } returns Membership.None coEvery { getOneToOneConversation(USER_ID) } returns flowOf( - GetOneToOneConversationUseCase.Result.Success(OtherUserProfileScreenViewModelTest.CONVERSATION) + GetOneToOneConversationDetailsUseCase.Result.Success(OtherUserProfileScreenViewModelTest.CONVERSATION_ONE_ONE) ) coEvery { getUserE2eiCertificateStatus.invoke(any()) } returns true coEvery { getUserE2eiCertificates.invoke(any()) } returns mapOf() @@ -177,7 +177,7 @@ internal class OtherUserProfileViewModelArrangement { ) } - fun withGetOneToOneConversation(result: GetOneToOneConversationUseCase.Result) = apply { + fun withGetOneToOneConversation(result: GetOneToOneConversationDetailsUseCase.Result) = apply { coEvery { getOneToOneConversation(USER_ID) } returns flowOf(result) } diff --git a/kalium b/kalium index e21b0a87e27..76d22069a42 160000 --- a/kalium +++ b/kalium @@ -1 +1 @@ -Subproject commit e21b0a87e2763187d2773652b0cb3992b45e7bc2 +Subproject commit 76d22069a427fd4564783de39678e857c86d1eaf