diff --git a/app/src/main/kotlin/com/wire/android/di/CoreLogicModule.kt b/app/src/main/kotlin/com/wire/android/di/CoreLogicModule.kt index 81d813ee948..bea47ad95d2 100644 --- a/app/src/main/kotlin/com/wire/android/di/CoreLogicModule.kt +++ b/app/src/main/kotlin/com/wire/android/di/CoreLogicModule.kt @@ -35,6 +35,7 @@ import com.wire.kalium.logic.feature.connection.BlockUserUseCase import com.wire.kalium.logic.feature.connection.UnblockUserUseCase import com.wire.kalium.logic.feature.conversation.ObserveOtherUserSecurityClassificationLabelUseCase import com.wire.kalium.logic.feature.conversation.ObserveSecurityClassificationLabelUseCase +import com.wire.kalium.logic.feature.e2ei.usecase.FetchConversationMLSVerificationStatusUseCase import com.wire.kalium.logic.feature.featureConfig.ObserveIsAppLockEditableUseCase import com.wire.kalium.logic.feature.selfDeletingMessages.ObserveSelfDeletionTimerSettingsForConversationUseCase import com.wire.kalium.logic.feature.selfDeletingMessages.ObserveTeamSettingsSelfDeletingStatusUseCase @@ -445,4 +446,11 @@ class UseCaseModule { fun provideObserveIsAppLockEditableUseCase( @KaliumCoreLogic coreLogic: CoreLogic ): ObserveIsAppLockEditableUseCase = coreLogic.getGlobalScope().observeIsAppLockEditableUseCase + + @ViewModelScoped + @Provides + fun provideFetchConversationMLSVerificationStatusUseCase( + @KaliumCoreLogic coreLogic: CoreLogic, + @CurrentAccount currentAccount: UserId + ): FetchConversationMLSVerificationStatusUseCase = coreLogic.getSessionScope(currentAccount).fetchConversationMLSVerificationStatus } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/info/ConversationInfoViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/info/ConversationInfoViewModel.kt index f7ba4647941..a0d6c7cc135 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/info/ConversationInfoViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/info/ConversationInfoViewModel.kt @@ -39,6 +39,7 @@ import com.wire.kalium.logic.data.id.QualifiedIdMapper import com.wire.kalium.logic.data.user.ConnectionState import com.wire.kalium.logic.data.user.UserId import com.wire.kalium.logic.feature.conversation.ObserveConversationDetailsUseCase +import com.wire.kalium.logic.feature.e2ei.usecase.FetchConversationMLSVerificationStatusUseCase import com.wire.kalium.logic.feature.user.GetSelfUserUseCase import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.first @@ -52,6 +53,7 @@ class ConversationInfoViewModel @Inject constructor( override val savedStateHandle: SavedStateHandle, private val observeConversationDetails: ObserveConversationDetailsUseCase, private val observerSelfUser: GetSelfUserUseCase, + private val fetchConversationMLSVerificationStatus: FetchConversationMLSVerificationStatusUseCase, private val wireSessionImageLoader: WireSessionImageLoader, ) : SavedStateViewModel(savedStateHandle) { @@ -64,6 +66,13 @@ class ConversationInfoViewModel @Inject constructor( init { getSelfUserId() + fetchMLSVerificationStatus() + } + + private fun fetchMLSVerificationStatus() { + viewModelScope.launch { + fetchConversationMLSVerificationStatus(conversationId) + } } private fun getSelfUserId() { diff --git a/app/src/test/kotlin/com/wire/android/ui/home/conversations/info/ConversationInfoViewModelArrangement.kt b/app/src/test/kotlin/com/wire/android/ui/home/conversations/info/ConversationInfoViewModelArrangement.kt index 5a17b46ecb8..397c3e3107b 100644 --- a/app/src/test/kotlin/com/wire/android/ui/home/conversations/info/ConversationInfoViewModelArrangement.kt +++ b/app/src/test/kotlin/com/wire/android/ui/home/conversations/info/ConversationInfoViewModelArrangement.kt @@ -31,6 +31,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.feature.conversation.ObserveConversationDetailsUseCase +import com.wire.kalium.logic.feature.e2ei.usecase.FetchConversationMLSVerificationStatusUseCase import com.wire.kalium.logic.feature.user.GetSelfUserUseCase import io.mockk.MockKAnnotations import io.mockk.coEvery @@ -59,6 +60,9 @@ class ConversationInfoViewModelArrangement { @MockK lateinit var observerSelfUser: GetSelfUserUseCase + @MockK + lateinit var fetchConversationMLSVerificationStatus: FetchConversationMLSVerificationStatusUseCase + @MockK private lateinit var wireSessionImageLoader: WireSessionImageLoader @@ -71,6 +75,7 @@ class ConversationInfoViewModelArrangement { savedStateHandle, observeConversationDetails, observerSelfUser, + fetchConversationMLSVerificationStatus, wireSessionImageLoader ) } @@ -86,6 +91,7 @@ class ConversationInfoViewModelArrangement { coEvery { observeConversationDetails(any()) } returns conversationDetailsChannel.consumeAsFlow().map { ObserveConversationDetailsUseCase.Result.Success(it) } + coEvery { fetchConversationMLSVerificationStatus.invoke(any()) } returns Unit } suspend fun withConversationDetailUpdate(conversationDetails: ConversationDetails) = apply { diff --git a/kalium b/kalium index b1520bec82e..2931055c9f9 160000 --- a/kalium +++ b/kalium @@ -1 +1 @@ -Subproject commit b1520bec82e8b2625837887f8b806b1e7e16bb5d +Subproject commit 2931055c9f9465dd0edd161fa5b2ea29beed3ebd