diff --git a/app/src/main/kotlin/com/wire/android/ui/WireActivity.kt b/app/src/main/kotlin/com/wire/android/ui/WireActivity.kt index 9ea51911f6c..37e0979029e 100644 --- a/app/src/main/kotlin/com/wire/android/ui/WireActivity.kt +++ b/app/src/main/kotlin/com/wire/android/ui/WireActivity.kt @@ -85,6 +85,7 @@ import com.wire.android.ui.home.E2EICertificateRevokedDialog import com.wire.android.ui.home.E2EIRequiredDialog import com.wire.android.ui.home.E2EIResultDialog import com.wire.android.ui.home.E2EISnoozeDialog +import com.wire.android.ui.home.FeatureFlagState import com.wire.android.ui.home.appLock.LockCodeTimeManager import com.wire.android.ui.home.sync.FeatureFlagNotificationViewModel import com.wire.android.ui.legalhold.dialog.deactivated.LegalHoldDeactivatedDialog @@ -328,7 +329,7 @@ class WireActivity : AppCompatActivity() { } if (showFileSharingDialog) { FileRestrictionDialog( - isFileSharingEnabled = isFileSharingEnabledState, + isFileSharingEnabled = (isFileSharingState !is FeatureFlagState.FileSharingState.DisabledByTeam), hideDialogStatus = featureFlagNotificationViewModel::dismissFileSharingDialog ) } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/FeatureFlagState.kt b/app/src/main/kotlin/com/wire/android/ui/home/FeatureFlagState.kt index ed540612adf..673ddeaf07f 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/FeatureFlagState.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/FeatureFlagState.kt @@ -23,8 +23,7 @@ import kotlin.time.Duration data class FeatureFlagState( val showFileSharingDialog: Boolean = false, - val isFileSharingEnabledState: Boolean = true, - val fileSharingRestrictedState: SharingRestrictedState? = null, + val isFileSharingState: FileSharingState = FileSharingState.NoUser, val shouldShowGuestRoomLinkDialog: Boolean = false, val shouldShowE2eiCertificateRevokedDialog: Boolean = false, val shouldShowTeamAppLockDialog: Boolean = false, @@ -40,8 +39,12 @@ data class FeatureFlagState( val showCallEndedBecauseOfConversationDegraded: Boolean = false, val startGettingE2EICertificate: Boolean = false ) { - enum class SharingRestrictedState { - NONE, NO_USER, RESTRICTED_IN_TEAM + + sealed interface FileSharingState { + data object NoUser : FileSharingState + data object AllowAll : FileSharingState + data class AllowSome(val allowedList: List) : FileSharingState + data object DisabledByTeam : FileSharingState } data class E2EISnooze(val timeLeft: Duration) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationMessageType.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationMessageType.kt index 2805ba03620..8e79e75ee19 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationMessageType.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/ConversationMessageType.kt @@ -29,6 +29,7 @@ sealed class ConversationSnackbarMessages(override val uiText: UIText) : SnackBa object ErrorDownloadingAsset : ConversationSnackbarMessages(UIText.StringResource(R.string.error_conversation_downloading_asset)) object ErrorOpeningAssetFile : ConversationSnackbarMessages(UIText.StringResource(R.string.error_conversation_opening_asset_file)) object ErrorDeletingMessage : ConversationSnackbarMessages(UIText.StringResource(R.string.error_conversation_deleting_message)) + data object ErrorAssetRestriction : ConversationSnackbarMessages(UIText.StringResource(R.string.restricted_asset_error_toast_message)) data class ErrorMaxAssetSize(val maxLimitInMB: Int) : ConversationSnackbarMessages(UIText.StringResource(R.string.error_conversation_max_asset_size_limit, maxLimitInMB)) diff --git a/app/src/main/kotlin/com/wire/android/ui/home/conversations/MessageComposerViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/home/conversations/MessageComposerViewModel.kt index ff1c167bf58..d355d7f18c1 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/conversations/MessageComposerViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/conversations/MessageComposerViewModel.kt @@ -347,6 +347,7 @@ class MessageComposerViewModel @Inject constructor( } } + @Suppress("LongMethod") internal fun sendAttachment(attachmentBundle: AssetBundle?) { viewModelScope.launch { withContext(dispatchers.io()) { @@ -366,7 +367,9 @@ class MessageComposerViewModel @Inject constructor( assetDataSize = dataSize, assetMimeType = mimeType, audioLengthInMs = 0L - ).handleLegalHoldFailureAfterSendingMessage() + ).also { + handleAssetSendingResult(it) + } } AttachmentType.VIDEO, @@ -385,7 +388,9 @@ class MessageComposerViewModel @Inject constructor( dataPath = dataPath, mimeType = mimeType ) - ).handleLegalHoldFailureAfterSendingMessage() + ).also { + handleAssetSendingResult(it) + } } catch (e: OutOfMemoryError) { appLogger.e("There was an OutOfMemory error while uploading the asset") onSnackbarMessage(ConversationSnackbarMessages.ErrorSendingAsset) @@ -397,6 +402,23 @@ class MessageComposerViewModel @Inject constructor( } } + private suspend fun handleAssetSendingResult(result: ScheduleNewAssetMessageResult) { + when (result) { + is ScheduleNewAssetMessageResult.Failure.Generic -> { + result.coreFailure.handleLegalHoldFailureAfterSendingMessage() + } + is ScheduleNewAssetMessageResult.Success -> { + /* no-op */ + } + + ScheduleNewAssetMessageResult.Failure.DisabledByTeam, + ScheduleNewAssetMessageResult.Failure.RestrictedFileType -> { + withContext(dispatchers.main()) { + onSnackbarMessage(ConversationSnackbarMessages.ErrorAssetRestriction) + } + } + } + } private fun CoreFailure.handleLegalHoldFailureAfterSendingMessage() = also { if (this is LegalHoldEnabledForConversationFailure) { sureAboutMessagingDialogState = SureAboutMessagingDialogState.Visible.ConversationUnderLegalHold.AfterSending(this.messageId) @@ -406,12 +428,6 @@ class MessageComposerViewModel @Inject constructor( private fun Either.handleLegalHoldFailureAfterSendingMessage() = onFailure { it.handleLegalHoldFailureAfterSendingMessage() } - private fun ScheduleNewAssetMessageResult.handleLegalHoldFailureAfterSendingMessage() = also { - if (it is ScheduleNewAssetMessageResult.Failure) { - it.coreFailure.handleLegalHoldFailureAfterSendingMessage() - } - } - fun retrySendingMessage(messageId: String) { viewModelScope.launch { retryFailedMessage(messageId = messageId, conversationId = conversationId) @@ -449,13 +465,12 @@ class MessageComposerViewModel @Inject constructor( } private fun setFileSharingStatus() { - // TODO: handle restriction when sending assets viewModelScope.launch { messageComposerViewState.value = when (isFileSharingEnabled().state) { - FileSharingStatus.Value.Disabled, - is FileSharingStatus.Value.EnabledSome -> + FileSharingStatus.Value.Disabled -> messageComposerViewState.value.copy(isFileSharingEnabled = false) + is FileSharingStatus.Value.EnabledSome, FileSharingStatus.Value.EnabledAll -> messageComposerViewState.value.copy(isFileSharingEnabled = true) } diff --git a/app/src/main/kotlin/com/wire/android/ui/home/sync/FeatureFlagNotificationViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/home/sync/FeatureFlagNotificationViewModel.kt index 916e1a12017..c3e41b67a5f 100644 --- a/app/src/main/kotlin/com/wire/android/ui/home/sync/FeatureFlagNotificationViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/home/sync/FeatureFlagNotificationViewModel.kt @@ -87,14 +87,14 @@ class FeatureFlagNotificationViewModel @Inject constructor( currentUserId = null appLogger.i("$TAG: Failure while getting current session") featureFlagState = FeatureFlagState( // no session, clear feature flag state to default and set NO_USER - fileSharingRestrictedState = FeatureFlagState.SharingRestrictedState.NO_USER + isFileSharingState = FeatureFlagState.FileSharingState.NoUser ) } currentSessionResult is CurrentSessionResult.Success && !currentSessionResult.accountInfo.isValid() -> { appLogger.i("$TAG: Invalid current session") featureFlagState = FeatureFlagState( // invalid session, clear feature flag state to default and set NO_USER - fileSharingRestrictedState = FeatureFlagState.SharingRestrictedState.NO_USER + isFileSharingState = FeatureFlagState.FileSharingState.NoUser ) } @@ -132,22 +132,17 @@ class FeatureFlagNotificationViewModel @Inject constructor( private suspend fun setFileSharingState(userId: UserId) { coreLogic.getSessionScope(userId).observeFileSharingStatus().collect { fileSharingStatus -> - fileSharingStatus.state?.let { - // TODO: handle restriction when sending assets - val (fileSharingRestrictedState, state) = if (it is FileSharingStatus.Value.EnabledAll) { - FeatureFlagState.SharingRestrictedState.NONE to true - } else { - FeatureFlagState.SharingRestrictedState.RESTRICTED_IN_TEAM to false - } - - featureFlagState = featureFlagState.copy( - fileSharingRestrictedState = fileSharingRestrictedState, - isFileSharingEnabledState = state + val state: FeatureFlagState.FileSharingState = when (fileSharingStatus.state) { + FileSharingStatus.Value.Disabled -> FeatureFlagState.FileSharingState.DisabledByTeam + FileSharingStatus.Value.EnabledAll -> FeatureFlagState.FileSharingState.AllowAll + is FileSharingStatus.Value.EnabledSome -> FeatureFlagState.FileSharingState.AllowSome( + (fileSharingStatus.state as FileSharingStatus.Value.EnabledSome).allowedType ) } - fileSharingStatus.isStatusChanged?.let { - featureFlagState = featureFlagState.copy(showFileSharingDialog = it) - } + featureFlagState = featureFlagState.copy( + isFileSharingState = state, + showFileSharingDialog = fileSharingStatus.isStatusChanged ?: false + ) } } diff --git a/app/src/main/kotlin/com/wire/android/ui/sharing/ImportMediaAuthenticatedViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/sharing/ImportMediaAuthenticatedViewModel.kt index 0df4866b6be..67c6f56f97d 100644 --- a/app/src/main/kotlin/com/wire/android/ui/sharing/ImportMediaAuthenticatedViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/sharing/ImportMediaAuthenticatedViewModel.kt @@ -21,6 +21,7 @@ import android.content.Context import android.content.Intent import android.net.Uri import android.os.Parcelable +import android.widget.Toast import androidx.appcompat.app.AppCompatActivity import androidx.compose.runtime.Stable import androidx.compose.runtime.getValue @@ -31,6 +32,7 @@ import androidx.core.app.ShareCompat import androidx.core.net.toUri import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope +import com.wire.android.R import com.wire.android.appLogger import com.wire.android.mapper.UserTypeMapper import com.wire.android.mapper.toUIPreview @@ -69,6 +71,7 @@ import com.wire.kalium.logic.feature.selfDeletingMessages.ObserveSelfDeletionTim import com.wire.kalium.logic.feature.selfDeletingMessages.PersistNewSelfDeletionTimerUseCase import com.wire.kalium.logic.feature.user.GetSelfUserUseCase import dagger.hilt.android.lifecycle.HiltViewModel +import dagger.hilt.android.qualifiers.ApplicationContext import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.Job @@ -90,6 +93,7 @@ import javax.inject.Inject @OptIn(FlowPreview::class) @Suppress("LongParameterList", "TooManyFunctions") class ImportMediaAuthenticatedViewModel @Inject constructor( + @ApplicationContext private val context: Context, private val getSelf: GetSelfUserUseCase, private val userTypeMapper: UserTypeMapper, private val observeConversationListDetails: ObserveConversationListDetailsUseCase, @@ -363,13 +367,26 @@ class ImportMediaAuthenticatedViewModel @Inject constructor( mimeType = importedAsset.mimeType ) ).also { - val logConversationId = conversation.conversationId.toLogString() - if (it is ScheduleNewAssetMessageResult.Failure) { - appLogger.e("Failed to import asset message to " + - "conversationId=$logConversationId") - } else { - appLogger.d("Success importing asset message to " + - "conversationId=$logConversationId") + when (it) { + is ScheduleNewAssetMessageResult.Success -> appLogger.d( + "Successfully imported asset message to conversationId=${conversation.conversationId.toLogString()}" + ) + + is ScheduleNewAssetMessageResult.Failure.Generic -> appLogger.e( + "Failed to import asset message to conversationId=${conversation.conversationId.toLogString()}" + ) + + ScheduleNewAssetMessageResult.Failure.RestrictedFileType, + ScheduleNewAssetMessageResult.Failure.DisabledByTeam -> { + Toast.makeText( + context, + R.string.restricted_asset_error_toast_message, + Toast.LENGTH_SHORT + ).show() + appLogger.e( + "Failed to import asset message to conversationId=${conversation.conversationId.toLogString()}" + ) + } } } } @@ -497,5 +514,10 @@ data class ImportMediaAuthenticatedState( val isImporting: Boolean = false, val shareableConversationListState: ShareableConversationListState = ShareableConversationListState(), val selectedConversationItem: List = emptyList(), - val selfDeletingTimer: SelfDeletionTimer = SelfDeletionTimer.Enabled(null) + val selfDeletingTimer: SelfDeletionTimer = SelfDeletionTimer.Enabled(null), + val assetSendError: AssetSendError? = null ) + +enum class AssetSendError { + DISABLED_BY_TEAM, RESTRICTED_ASSET +} diff --git a/app/src/main/kotlin/com/wire/android/ui/sharing/ImportMediaScreen.kt b/app/src/main/kotlin/com/wire/android/ui/sharing/ImportMediaScreen.kt index 97eedec1540..355dcddde9e 100644 --- a/app/src/main/kotlin/com/wire/android/ui/sharing/ImportMediaScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/sharing/ImportMediaScreen.kt @@ -98,16 +98,15 @@ fun ImportMediaScreen( navigator: Navigator, featureFlagNotificationViewModel: FeatureFlagNotificationViewModel = hiltViewModel() ) { - when (val fileSharingRestrictedState = - featureFlagNotificationViewModel.featureFlagState.fileSharingRestrictedState) { - FeatureFlagState.SharingRestrictedState.NO_USER -> { + when (val fileSharingRestrictedState = featureFlagNotificationViewModel.featureFlagState.isFileSharingState) { + FeatureFlagState.FileSharingState.NoUser -> { ImportMediaLoggedOutContent( fileSharingRestrictedState = fileSharingRestrictedState, navigateBack = navigator::navigateBack ) } - FeatureFlagState.SharingRestrictedState.RESTRICTED_IN_TEAM -> { + FeatureFlagState.FileSharingState.DisabledByTeam -> { val importMediaViewModel: ImportMediaAuthenticatedViewModel = hiltViewModel() ImportMediaRestrictedContent( fileSharingRestrictedState = fileSharingRestrictedState, @@ -116,7 +115,8 @@ fun ImportMediaScreen( ) } - FeatureFlagState.SharingRestrictedState.NONE -> { + FeatureFlagState.FileSharingState.AllowAll, + is FeatureFlagState.FileSharingState.AllowSome -> { val importMediaViewModel: ImportMediaAuthenticatedViewModel = hiltViewModel() ImportMediaRegularContent( importMediaAuthenticatedState = importMediaViewModel.importMediaState, @@ -144,10 +144,6 @@ fun ImportMediaScreen( } } } - - null -> { - // state is not calculated yet, need to wait to avoid crash while requesting currentUser where it's absent - } } BackHandler { navigator.navigateBack() } @@ -155,7 +151,7 @@ fun ImportMediaScreen( @Composable fun ImportMediaRestrictedContent( - fileSharingRestrictedState: FeatureFlagState.SharingRestrictedState, + fileSharingRestrictedState: FeatureFlagState.FileSharingState, importMediaAuthenticatedState: ImportMediaAuthenticatedState, navigateBack: () -> Unit, ) { @@ -247,7 +243,7 @@ fun ImportMediaRegularContent( @Composable fun ImportMediaLoggedOutContent( - fileSharingRestrictedState: FeatureFlagState.SharingRestrictedState, + fileSharingRestrictedState: FeatureFlagState.FileSharingState, navigateBack: () -> Unit, ) { WireScaffold( @@ -272,7 +268,7 @@ fun ImportMediaLoggedOutContent( @Composable fun FileSharingRestrictedContent( internalPadding: PaddingValues, - sharingRestrictedState: FeatureFlagState.SharingRestrictedState, + sharingRestrictedState: FeatureFlagState.FileSharingState, openWireAction: () -> Unit ) { val context = LocalContext.current @@ -287,7 +283,7 @@ fun FileSharingRestrictedContent( .padding(horizontal = dimensions().spacing48x) ) { val textRes = - if (sharingRestrictedState == FeatureFlagState.SharingRestrictedState.NO_USER) { + if (sharingRestrictedState == FeatureFlagState.FileSharingState.NoUser) { R.string.file_sharing_restricted_description_no_users } else { R.string.file_sharing_restricted_description_by_team @@ -301,7 +297,7 @@ fun FileSharingRestrictedContent( Spacer(modifier = Modifier.height(dimensions().spacing16x)) - if (sharingRestrictedState == FeatureFlagState.SharingRestrictedState.NO_USER) { + if (sharingRestrictedState == FeatureFlagState.FileSharingState.NoUser) { WirePrimaryButton( onClick = openWireAction, text = stringResource(R.string.file_sharing_restricted_button_text_no_users), @@ -459,14 +455,14 @@ private fun SnackBarMessage( @Preview(showBackground = true) @Composable fun PreviewImportMediaScreenLoggedOut() { - ImportMediaLoggedOutContent(FeatureFlagState.SharingRestrictedState.NO_USER) {} + ImportMediaLoggedOutContent(FeatureFlagState.FileSharingState.NoUser) {} } @Preview(showBackground = true) @Composable fun PreviewImportMediaScreenRestricted() { ImportMediaRestrictedContent( - FeatureFlagState.SharingRestrictedState.RESTRICTED_IN_TEAM, + FeatureFlagState.FileSharingState.DisabledByTeam, ImportMediaAuthenticatedState() ) {} } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a5b0977db6a..dfc72b041c3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1396,4 +1396,6 @@ Allow Wire to access your device location to send your location. Please wait... Location could not be shared + + Sending of files is forbidden due to company restrictions diff --git a/app/src/test/kotlin/com/wire/android/ui/home/conversations/MessageComposerViewModelArrangement.kt b/app/src/test/kotlin/com/wire/android/ui/home/conversations/MessageComposerViewModelArrangement.kt index 4d7fe9ab41b..08e19a5f97a 100644 --- a/app/src/test/kotlin/com/wire/android/ui/home/conversations/MessageComposerViewModelArrangement.kt +++ b/app/src/test/kotlin/com/wire/android/ui/home/conversations/MessageComposerViewModelArrangement.kt @@ -335,6 +335,21 @@ internal class MessageComposerViewModelArrangement { } returns Unit } + fun withSendAssetsResult(result: ScheduleNewAssetMessageResult) = apply { + coEvery { + sendAssetMessage( + any(), + any(), + any(), + any(), + any(), + any(), + any(), + any() + ) + } returns result + } + fun withFailureOnDeletingMessages() = apply { coEvery { deleteMessage(any(), any(), any()) } returns Either.Left(CoreFailure.Unknown(null)) return this diff --git a/app/src/test/kotlin/com/wire/android/ui/home/conversations/MessageComposerViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/home/conversations/MessageComposerViewModelTest.kt index c93b3293189..4ec271e3a75 100644 --- a/app/src/test/kotlin/com/wire/android/ui/home/conversations/MessageComposerViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/home/conversations/MessageComposerViewModelTest.kt @@ -36,6 +36,7 @@ import com.wire.kalium.logic.failure.LegalHoldEnabledForConversationFailure import com.wire.kalium.logic.feature.asset.GetAssetSizeLimitUseCaseImpl.Companion.ASSET_SIZE_DEFAULT_LIMIT_BYTES import com.wire.kalium.logic.feature.conversation.InteractionAvailability import com.wire.kalium.logic.feature.session.CurrentSessionResult +import com.wire.kalium.logic.feature.asset.ScheduleNewAssetMessageResult import io.mockk.coVerify import io.mockk.verify import kotlinx.coroutines.ExperimentalCoroutinesApi @@ -542,6 +543,84 @@ class MessageComposerViewModelTest { assertEquals(expectedDuration, viewModel.messageComposerViewState.value.selfDeletionTimer.duration) } + @Test + fun `given mimeType is DisabledByTeam, when trying to send, then show message to user`() = + runTest { + // Given + val limit = ASSET_SIZE_DEFAULT_LIMIT_BYTES + val (arrangement, viewModel) = MessageComposerViewModelArrangement() + .withSuccessfulViewModelInit() + .withGetAssetSizeLimitUseCase(false, limit) + .withSendAssetsResult(ScheduleNewAssetMessageResult.Failure.DisabledByTeam) + .arrange() + val mockedAttachment = AssetBundle( + "application/pdf", + "some-data-path".toPath(), + 1L, + "mocked_file.pdf", + AttachmentType.GENERIC_FILE + ) + + // When + viewModel.infoMessage.test { + viewModel.sendAttachment(mockedAttachment) + + // Then + coVerify(exactly = 1) { + arrangement.sendAssetMessage.invoke( + any(), + any(), + any(), + any(), + any(), + any(), + any(), + any() + ) + } + assertEquals(ConversationSnackbarMessages.ErrorAssetRestriction, awaitItem()) + } + } + + @Test + fun `given mimeType is RestrictedFileType, when trying to send, then show message to user`() = + runTest { + // Given + val limit = ASSET_SIZE_DEFAULT_LIMIT_BYTES + val (arrangement, viewModel) = MessageComposerViewModelArrangement() + .withSuccessfulViewModelInit() + .withGetAssetSizeLimitUseCase(false, limit) + .withSendAssetsResult(ScheduleNewAssetMessageResult.Failure.RestrictedFileType) + .arrange() + val mockedAttachment = AssetBundle( + "application/pdf", + "some-data-path".toPath(), + 1L, + "mocked_file.pdf", + AttachmentType.GENERIC_FILE + ) + + // When + viewModel.infoMessage.test { + viewModel.sendAttachment(mockedAttachment) + + // Then + coVerify(exactly = 1) { + arrangement.sendAssetMessage.invoke( + any(), + any(), + any(), + any(), + any(), + any(), + any(), + any() + ) + } + assertEquals(ConversationSnackbarMessages.ErrorAssetRestriction, awaitItem()) + } + } + @Test fun `given the user sends an audio message, when invoked, then sendAssetMessageUseCase gets called`() = runTest { diff --git a/app/src/test/kotlin/com/wire/android/ui/home/sync/FeatureFlagNotificationViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/home/sync/FeatureFlagNotificationViewModelTest.kt index 8e71c6d0401..7665124d460 100644 --- a/app/src/test/kotlin/com/wire/android/ui/home/sync/FeatureFlagNotificationViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/home/sync/FeatureFlagNotificationViewModelTest.kt @@ -69,8 +69,8 @@ class FeatureFlagNotificationViewModelTest { advanceUntilIdle() assertEquals( - expected = FeatureFlagState.SharingRestrictedState.NO_USER, - actual = viewModel.featureFlagState.fileSharingRestrictedState + expected = FeatureFlagState.FileSharingState.NoUser, + actual = viewModel.featureFlagState.isFileSharingState ) } @@ -83,8 +83,8 @@ class FeatureFlagNotificationViewModelTest { advanceUntilIdle() assertEquals( - expected = FeatureFlagState.SharingRestrictedState.RESTRICTED_IN_TEAM, - actual = viewModel.featureFlagState.fileSharingRestrictedState + expected = FeatureFlagState.FileSharingState.DisabledByTeam, + actual = viewModel.featureFlagState.isFileSharingState ) } @@ -114,8 +114,8 @@ class FeatureFlagNotificationViewModelTest { advanceUntilIdle() assertEquals( - expected = FeatureFlagState.SharingRestrictedState.NONE, - actual = viewModel.featureFlagState.fileSharingRestrictedState + expected = FeatureFlagState.FileSharingState.AllowAll, + actual = viewModel.featureFlagState.isFileSharingState ) } diff --git a/kalium b/kalium index 1fdaa4f0872..81429bec31d 160000 --- a/kalium +++ b/kalium @@ -1 +1 @@ -Subproject commit 1fdaa4f0872250d3889ff8baeb04f7c00d28cac2 +Subproject commit 81429bec31d9fbf2bfb61dc243505a70084beaf7