From 4bdc5df38c84045529d6b2572dbd5264326124f1 Mon Sep 17 00:00:00 2001 From: boris Date: Thu, 25 Apr 2024 13:38:42 +0000 Subject: [PATCH 1/2] Commit with unresolved merge conflicts outside of kalium --- .../di/accountScoped/ConversationModule.kt | 8 ++- .../ui/connection/ConnectionActionButton.kt | 60 ++++++++++++++++++- .../ConnectionActionButtonViewModel.kt | 23 ++++++- .../other/OtherUserProfileScreen.kt | 2 + .../other/OtherUserProfileScreenViewModel.kt | 9 +++ .../other/OtherUserProfileState.kt | 4 ++ app/src/main/res/values/strings.xml | 4 ++ .../ConnectionActionButtonViewModelTest.kt | 28 ++++++++- .../OtherUserProfileViewModelArrangement.kt | 6 ++ 9 files changed, 138 insertions(+), 6 deletions(-) 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 15263096e2a..793d61c499a 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 @@ -30,6 +30,7 @@ import com.wire.kalium.logic.feature.conversation.CreateGroupConversationUseCase import com.wire.kalium.logic.feature.conversation.GetConversationUnreadEventsCountUseCase import com.wire.kalium.logic.feature.conversation.GetOneToOneConversationUseCase import com.wire.kalium.logic.feature.conversation.GetOrCreateOneToOneConversationUseCase +import com.wire.kalium.logic.feature.conversation.IsOneToOneConversationCreatedUseCase import com.wire.kalium.logic.feature.conversation.JoinConversationViaCodeUseCase import com.wire.kalium.logic.feature.conversation.LeaveConversationUseCase import com.wire.kalium.logic.feature.conversation.NotifyConversationIsOpenUseCase @@ -38,9 +39,9 @@ import com.wire.kalium.logic.feature.conversation.ObserveConversationDetailsUseC import com.wire.kalium.logic.feature.conversation.ObserveConversationInteractionAvailabilityUseCase import com.wire.kalium.logic.feature.conversation.ObserveConversationListDetailsUseCase import com.wire.kalium.logic.feature.conversation.ObserveConversationMembersUseCase +import com.wire.kalium.logic.feature.conversation.ObserveConversationUnderLegalHoldNotifiedUseCase import com.wire.kalium.logic.feature.conversation.ObserveDegradedConversationNotifiedUseCase import com.wire.kalium.logic.feature.conversation.ObserveIsSelfUserMemberUseCase -import com.wire.kalium.logic.feature.conversation.ObserveConversationUnderLegalHoldNotifiedUseCase import com.wire.kalium.logic.feature.conversation.ObserveUserListByIdUseCase import com.wire.kalium.logic.feature.conversation.ObserveUsersTypingUseCase import com.wire.kalium.logic.feature.conversation.RefreshConversationsWithoutMetadataUseCase @@ -292,6 +293,11 @@ class ConversationModule { @ViewModelScoped @Provides +<<<<<<< HEAD fun provideSyncConversationCodeUseCase(conversationScope: ConversationScope): SyncConversationCodeUseCase = conversationScope.syncConversationCode +======= + fun provideIsOneToOneConversationCreatedUseCase(conversationScope: ConversationScope): IsOneToOneConversationCreatedUseCase = + conversationScope.isOneToOneConversationCreatedUseCase +>>>>>>> 7b0fa7bcc (fix: Handle 1o1 conversations when no key packages [WPB-6936] (#2936)) } 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 1a27abc0ade..08a521a0277 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 @@ -23,25 +23,35 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import com.wire.android.R import com.wire.android.di.hiltViewModelScoped import com.wire.android.model.ClickBlockParams +import com.wire.android.ui.common.VisibilityState +import com.wire.android.ui.common.WireDialog +import com.wire.android.ui.common.WireDialogButtonProperties +import com.wire.android.ui.common.WireDialogButtonType import com.wire.android.ui.common.button.WireButtonState import com.wire.android.ui.common.button.WirePrimaryButton import com.wire.android.ui.common.button.WireSecondaryButton +import com.wire.android.ui.common.colorsScheme import com.wire.android.ui.common.dialogs.UnblockUserDialogContent import com.wire.android.ui.common.dialogs.UnblockUserDialogState import com.wire.android.ui.common.dimensions import com.wire.android.ui.common.snackbar.LocalSnackbarHostState import com.wire.android.ui.common.snackbar.collectAndShowSnackbar +import com.wire.android.ui.common.visbility.VisibilityState import com.wire.android.ui.common.visbility.rememberVisibilityState import com.wire.android.ui.legalhold.dialog.connectionfailed.LegalHoldSubjectConnectionFailedDialog import com.wire.android.ui.theme.WireTheme +import com.wire.android.ui.theme.wireTypography import com.wire.android.util.ui.PreviewMultipleThemes +import com.wire.android.util.ui.stringWithStyledArgs import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.user.ConnectionState import com.wire.kalium.logic.data.user.UserId @@ -50,7 +60,9 @@ import com.wire.kalium.logic.data.user.UserId fun ConnectionActionButton( userId: UserId, userName: String, + fullName: String, connectionStatus: ConnectionState, + isConversationStarted: Boolean, onConnectionRequestIgnored: (String) -> Unit = {}, onOpenConversation: (ConversationId) -> Unit = {}, viewModel: ConnectionActionButtonViewModel = @@ -60,6 +72,7 @@ fun ConnectionActionButton( ) { LocalSnackbarHostState.current.collectAndShowSnackbar(snackbarFlow = viewModel.infoMessage) val unblockUserDialogState = rememberVisibilityState() + val unableStartConversationDialogState = rememberVisibilityState() UnblockUserDialogContent( dialogState = unblockUserDialogState, @@ -67,6 +80,8 @@ fun ConnectionActionButton( isLoading = viewModel.actionableState().isPerformingAction, ) + UnableStartConversationDialogContent(dialogState = unableStartConversationDialogState) + if (!viewModel.actionableState().isPerformingAction) { unblockUserDialogState.dismiss() } @@ -86,9 +101,13 @@ fun ConnectionActionButton( ) ConnectionState.ACCEPTED -> WirePrimaryButton( - text = stringResource(R.string.label_open_conversation), + text = stringResource(if (isConversationStarted) R.string.label_open_conversation else R.string.label_start_conversation), loading = viewModel.actionableState().isPerformingAction, - onClick = { viewModel.onOpenConversation(onOpenConversation) }, + onClick = { + viewModel.onOpenConversation(onOpenConversation) { + unableStartConversationDialogState.show(UnableStartConversationDialogState(fullName)) + } + }, ) ConnectionState.IGNORED -> WirePrimaryButton( @@ -174,6 +193,31 @@ fun ConnectionActionButton( } } +@Composable +fun UnableStartConversationDialogContent(dialogState: VisibilityState) { + VisibilityState(dialogState) { state -> + WireDialog( + title = stringResource(id = R.string.missing_keypackage_dialog_title), + text = LocalContext.current.resources.stringWithStyledArgs( + R.string.missing_keypackage_dialog_body, + MaterialTheme.wireTypography.body01, + MaterialTheme.wireTypography.body02, + colorsScheme().onBackground, + colorsScheme().onBackground, + state.userName + ), + onDismiss = dialogState::dismiss, + optionButton1Properties = WireDialogButtonProperties( + onClick = dialogState::dismiss, + text = stringResource(id = R.string.label_ok), + type = WireDialogButtonType.Primary, + ), + ) + } +} + +data class UnableStartConversationDialogState(val userName: String) + @Composable @PreviewMultipleThemes fun PreviewOtherUserConnectionActionButtonPending() { @@ -181,7 +225,9 @@ fun PreviewOtherUserConnectionActionButtonPending() { ConnectionActionButton( userId = UserId("value", "domain"), userName = "Username", + fullName = "some user", connectionStatus = ConnectionState.PENDING, + isConversationStarted = false ) } } @@ -193,7 +239,9 @@ fun PreviewOtherUserConnectionActionButtonNotConnected() { ConnectionActionButton( userId = UserId("value", "domain"), userName = "Username", + fullName = "some user", connectionStatus = ConnectionState.NOT_CONNECTED, + isConversationStarted = false ) } } @@ -205,7 +253,9 @@ fun PreviewOtherUserConnectionActionButtonBlocked() { ConnectionActionButton( userId = UserId("value", "domain"), userName = "Username", + fullName = "some user", connectionStatus = ConnectionState.BLOCKED, + isConversationStarted = false ) } } @@ -217,7 +267,9 @@ fun PreviewOtherUserConnectionActionButtonCanceled() { ConnectionActionButton( userId = UserId("value", "domain"), userName = "Username", + fullName = "some user", connectionStatus = ConnectionState.CANCELLED, + isConversationStarted = false ) } } @@ -229,7 +281,9 @@ fun PreviewOtherUserConnectionActionButtonAccepted() { ConnectionActionButton( userId = UserId("value", "domain"), userName = "Username", + fullName = "some user", connectionStatus = ConnectionState.ACCEPTED, + isConversationStarted = false ) } } @@ -241,7 +295,9 @@ fun PreviewOtherUserConnectionActionButtonSent() { ConnectionActionButton( userId = UserId("value", "domain"), userName = "Username", + fullName = "some user", connectionStatus = ConnectionState.SENT, + isConversationStarted = false ) } } diff --git a/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModel.kt index d636862e8e9..cb9170ecbfb 100644 --- a/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModel.kt @@ -26,11 +26,21 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.wire.android.R import com.wire.android.appLogger +import com.wire.android.di.ViewModelScopedPreview import com.wire.android.di.scopedArgs +<<<<<<< HEAD import com.wire.android.di.ViewModelScopedPreview import com.wire.android.util.dispatchers.DispatcherProvider import com.wire.android.util.ui.UIText import com.wire.kalium.logger.obfuscateId +======= +import com.wire.android.model.ActionableState +import com.wire.android.model.finishAction +import com.wire.android.model.performAction +import com.wire.android.util.dispatchers.DispatcherProvider +import com.wire.android.util.ui.UIText +import com.wire.kalium.logic.CoreFailure +>>>>>>> 7b0fa7bcc (fix: Handle 1o1 conversations when no key packages [WPB-6936] (#2936)) import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.QualifiedID import com.wire.kalium.logic.feature.connection.AcceptConnectionRequestUseCase @@ -57,14 +67,23 @@ import javax.inject.Inject interface ConnectionActionButtonViewModel { val infoMessage: SharedFlow get() = MutableSharedFlow() +<<<<<<< HEAD fun actionableState(): ConnectionActionState = ConnectionActionState() +======= + + fun actionableState(): ActionableState = ActionableState() +>>>>>>> 7b0fa7bcc (fix: Handle 1o1 conversations when no key packages [WPB-6936] (#2936)) fun onSendConnectionRequest() {} fun onCancelConnectionRequest() {} fun onAcceptConnectionRequest() {} fun onIgnoreConnectionRequest(onSuccess: (userName: String) -> Unit) {} fun onUnblockUser() {} +<<<<<<< HEAD fun onOpenConversation(onSuccess: (conversationId: ConversationId) -> Unit) {} fun onMissingLegalHoldConsentDismissed() {} +======= + fun onOpenConversation(onSuccess: (conversationId: ConversationId) -> Unit, onMissingKeyPackages: () -> Unit) {} +>>>>>>> 7b0fa7bcc (fix: Handle 1o1 conversations when no key packages [WPB-6936] (#2936)) } @Suppress("LongParameterList", "TooManyFunctions") @@ -190,17 +209,19 @@ class ConnectionActionButtonViewModelImpl @Inject constructor( } } - override fun onOpenConversation(onSuccess: (conversationId: ConversationId) -> Unit) { + override fun onOpenConversation(onSuccess: (conversationId: ConversationId) -> Unit, onMissingKeyPackages: () -> Unit) { viewModelScope.launch { state = state.performAction() when (val result = withContext(dispatchers.io()) { getOrCreateOneToOneConversation(userId) }) { is CreateConversationResult.Failure -> { appLogger.d(("Couldn't retrieve or create the conversation")) state = state.finishAction() + if (result.coreFailure is CoreFailure.MissingKeyPackages) onMissingKeyPackages() } is CreateConversationResult.Success -> onSuccess(result.conversation.id) } + state.finishAction() } } 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 922cbd74299..1cd3352fe91 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 @@ -562,7 +562,9 @@ private fun ContentFooter( ConnectionActionButton( state.userId, state.userName, + state.fullName, state.connectionState, + state.isConversationStarted, onIgnoreConnectionRequest, 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 4020413f089..6ee3e4ab374 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 @@ -64,6 +64,7 @@ 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.IsOneToOneConversationCreatedUseCase import com.wire.kalium.logic.feature.conversation.RemoveMemberFromConversationUseCase import com.wire.kalium.logic.feature.conversation.UpdateConversationArchivedStatusUseCase import com.wire.kalium.logic.feature.conversation.UpdateConversationMemberRoleResult @@ -108,6 +109,7 @@ class OtherUserProfileScreenViewModel @Inject constructor( private val updateConversationArchivedStatus: UpdateConversationArchivedStatusUseCase, private val getUserE2eiCertificateStatus: GetUserE2eiCertificateStatusUseCase, private val getUserE2eiCertificates: GetUserE2eiCertificatesUseCase, + private val isOneToOneConversationCreated: IsOneToOneConversationCreatedUseCase, savedStateHandle: SavedStateHandle ) : ViewModel(), OtherUserProfileEventsHandler, OtherUserProfileBottomSheetEventsHandler { @@ -135,6 +137,13 @@ class OtherUserProfileScreenViewModel @Inject constructor( observeUserInfoAndUpdateViewState() persistClients() getMLSVerificationStatus() + getIfConversationExist() + } + + private fun getIfConversationExist() { + viewModelScope.launch { + state = state.copy(isConversationStarted = isOneToOneConversationCreated(userId)) + } } private fun getMLSVerificationStatus() { diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileState.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileState.kt index 022638ee4fe..896f6b874cb 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileState.kt @@ -50,7 +50,11 @@ data class OtherUserProfileState( val blockingState: BlockingState = BlockingState.CAN_NOT_BE_BLOCKED, val isProteusVerified: Boolean = false, val isMLSVerified: Boolean = false, +<<<<<<< HEAD val isUnderLegalHold: Boolean = false, +======= + val isConversationStarted: Boolean = false +>>>>>>> 7b0fa7bcc (fix: Handle 1o1 conversations when no key packages [WPB-6936] (#2936)) ) { fun updateMuteStatus(status: MutedConversationStatus): OtherUserProfileState { return conversationSheetContent?.let { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index db347602669..41c3962c4f3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -803,6 +803,7 @@ HorizontalBouncingWritingPen transition Collapse button rotation degree transition Open Conversation + Start Conversation Email Phone @@ -885,6 +886,9 @@ Ignore Get certainty about the identity of %s\'s before connecting. Please verify the person\'s identity before accepting the connection request. + + Unable to start conversation + You can’t start the conversation with %1$s right now. %1$s needs to open Wire or log in again first. Please try again later. Media Gallery Saved to Downloads folder diff --git a/app/src/test/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModelTest.kt index d9d2b589434..1ca42505d07 100644 --- a/app/src/test/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModelTest.kt @@ -267,13 +267,14 @@ class ConnectionActionButtonViewModelTest { .arrange() // when - viewModel.onOpenConversation(arrangement.onOpenConversation) + viewModel.onOpenConversation(arrangement.onOpenConversation, arrangement.onMissingKeyPackages) // then coVerify { arrangement.getOrCreateOneToOneConversation(TestUser.USER_ID) } verify { arrangement.onOpenConversation(any()) } + verify { arrangement.onMissingKeyPackages wasNot Called } } @Test @@ -285,13 +286,33 @@ class ConnectionActionButtonViewModelTest { .arrange() // when - viewModel.onOpenConversation(arrangement.onOpenConversation) + viewModel.onOpenConversation(arrangement.onOpenConversation, arrangement.onMissingKeyPackages) // then coVerify { arrangement.getOrCreateOneToOneConversation(TestUser.USER_ID) } verify { arrangement.onOpenConversation wasNot Called } + verify { arrangement.onMissingKeyPackages wasNot Called } + } + + @Test + fun `given a conversationId, when trying to open the conversation and fails with MissingKeyPackages, then call MissingKeyPackage()`() = + runTest { + // given + val (arrangement, viewModel) = ConnectionActionButtonHiltArrangement() + .withGetOneToOneConversation(CreateConversationResult.Failure(CoreFailure.MissingKeyPackages(setOf()))) + .arrange() + + // when + viewModel.onOpenConversation(arrangement.onOpenConversation, arrangement.onMissingKeyPackages) + + // then + coVerify { + arrangement.getOrCreateOneToOneConversation(TestUser.USER_ID) + } + verify { arrangement.onOpenConversation wasNot Called } + verify { arrangement.onMissingKeyPackages() } } companion object { @@ -334,6 +355,9 @@ internal class ConnectionActionButtonHiltArrangement { @MockK(relaxed = true) lateinit var onOpenConversation: (conversationId: ConversationId) -> Unit + @MockK(relaxed = true) + lateinit var onMissingKeyPackages: () -> Unit + private val viewModel by lazy { ConnectionActionButtonViewModelImpl( TestDispatcherProvider(), 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 1729d4aa114..3dd80464f49 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 @@ -38,6 +38,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.GetOneToOneConversationUseCase +import com.wire.kalium.logic.feature.conversation.IsOneToOneConversationCreatedUseCase import com.wire.kalium.logic.feature.conversation.RemoveMemberFromConversationUseCase import com.wire.kalium.logic.feature.conversation.UpdateConversationArchivedStatusUseCase import com.wire.kalium.logic.feature.conversation.UpdateConversationMemberRoleResult @@ -112,6 +113,9 @@ internal class OtherUserProfileViewModelArrangement { @MockK lateinit var getUserE2eiCertificates: GetUserE2eiCertificatesUseCase + @MockK + lateinit var isOneToOneConversationCreated: IsOneToOneConversationCreatedUseCase + private val viewModel by lazy { OtherUserProfileScreenViewModel( TestDispatcherProvider(), @@ -131,6 +135,7 @@ internal class OtherUserProfileViewModelArrangement { updateConversationArchivedStatus, getUserE2eiCertificateStatus, getUserE2eiCertificates, + isOneToOneConversationCreated, savedStateHandle, ) } @@ -161,6 +166,7 @@ internal class OtherUserProfileViewModelArrangement { ) coEvery { getUserE2eiCertificateStatus.invoke(any()) } returns GetUserE2eiCertificateStatusResult.Success(CertificateStatus.VALID) coEvery { getUserE2eiCertificates.invoke(any()) } returns mapOf() + coEvery { isOneToOneConversationCreated.invoke(any()) } returns true } suspend fun withBlockUserResult(result: BlockUserResult) = apply { From f984266793a7980ffba1f9c835e6df978b4f2014 Mon Sep 17 00:00:00 2001 From: Boris Safonov Date: Mon, 29 Apr 2024 10:47:00 +0300 Subject: [PATCH 2/2] Resolve cherry-pick conflicts --- .../di/accountScoped/ConversationModule.kt | 6 +++--- .../ConnectionActionButtonViewModel.kt | 17 ----------------- .../userprofile/other/OtherUserProfileState.kt | 3 --- kalium | 2 +- 4 files changed, 4 insertions(+), 24 deletions(-) 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 793d61c499a..708f61eb24e 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 @@ -293,11 +293,11 @@ class ConversationModule { @ViewModelScoped @Provides -<<<<<<< HEAD fun provideSyncConversationCodeUseCase(conversationScope: ConversationScope): SyncConversationCodeUseCase = conversationScope.syncConversationCode -======= + + @ViewModelScoped + @Provides fun provideIsOneToOneConversationCreatedUseCase(conversationScope: ConversationScope): IsOneToOneConversationCreatedUseCase = conversationScope.isOneToOneConversationCreatedUseCase ->>>>>>> 7b0fa7bcc (fix: Handle 1o1 conversations when no key packages [WPB-6936] (#2936)) } diff --git a/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModel.kt index cb9170ecbfb..1c6eec7bd56 100644 --- a/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModel.kt @@ -26,21 +26,12 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.wire.android.R import com.wire.android.appLogger -import com.wire.android.di.ViewModelScopedPreview import com.wire.android.di.scopedArgs -<<<<<<< HEAD import com.wire.android.di.ViewModelScopedPreview import com.wire.android.util.dispatchers.DispatcherProvider import com.wire.android.util.ui.UIText import com.wire.kalium.logger.obfuscateId -======= -import com.wire.android.model.ActionableState -import com.wire.android.model.finishAction -import com.wire.android.model.performAction -import com.wire.android.util.dispatchers.DispatcherProvider -import com.wire.android.util.ui.UIText import com.wire.kalium.logic.CoreFailure ->>>>>>> 7b0fa7bcc (fix: Handle 1o1 conversations when no key packages [WPB-6936] (#2936)) import com.wire.kalium.logic.data.id.ConversationId import com.wire.kalium.logic.data.id.QualifiedID import com.wire.kalium.logic.feature.connection.AcceptConnectionRequestUseCase @@ -67,23 +58,15 @@ import javax.inject.Inject interface ConnectionActionButtonViewModel { val infoMessage: SharedFlow get() = MutableSharedFlow() -<<<<<<< HEAD fun actionableState(): ConnectionActionState = ConnectionActionState() -======= - - fun actionableState(): ActionableState = ActionableState() ->>>>>>> 7b0fa7bcc (fix: Handle 1o1 conversations when no key packages [WPB-6936] (#2936)) fun onSendConnectionRequest() {} fun onCancelConnectionRequest() {} fun onAcceptConnectionRequest() {} fun onIgnoreConnectionRequest(onSuccess: (userName: String) -> Unit) {} fun onUnblockUser() {} -<<<<<<< HEAD fun onOpenConversation(onSuccess: (conversationId: ConversationId) -> Unit) {} fun onMissingLegalHoldConsentDismissed() {} -======= fun onOpenConversation(onSuccess: (conversationId: ConversationId) -> Unit, onMissingKeyPackages: () -> Unit) {} ->>>>>>> 7b0fa7bcc (fix: Handle 1o1 conversations when no key packages [WPB-6936] (#2936)) } @Suppress("LongParameterList", "TooManyFunctions") diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileState.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileState.kt index 896f6b874cb..709c6018370 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileState.kt @@ -50,11 +50,8 @@ data class OtherUserProfileState( val blockingState: BlockingState = BlockingState.CAN_NOT_BE_BLOCKED, val isProteusVerified: Boolean = false, val isMLSVerified: Boolean = false, -<<<<<<< HEAD val isUnderLegalHold: Boolean = false, -======= val isConversationStarted: Boolean = false ->>>>>>> 7b0fa7bcc (fix: Handle 1o1 conversations when no key packages [WPB-6936] (#2936)) ) { fun updateMuteStatus(status: MutedConversationStatus): OtherUserProfileState { return conversationSheetContent?.let { diff --git a/kalium b/kalium index 1982c59d1b9..f2db3c63854 160000 --- a/kalium +++ b/kalium @@ -1 +1 @@ -Subproject commit 1982c59d1b96af0556380ebdb37d1b51d607076f +Subproject commit f2db3c638543526c01366189c07939e7f74984f5