Verified user badge.

Add disable action to verify user.
This commit is contained in:
Benoit Marty 2024-10-16 22:28:16 +02:00 committed by Benoit Marty
parent 8efbd67eea
commit 5378c4efad
10 changed files with 107 additions and 20 deletions

View file

@ -23,6 +23,7 @@ import kotlinx.coroutines.flow.flowOf
class FakeEncryptionService(
var startIdentityResetLambda: () -> Result<IdentityResetHandle?> = { lambdaError() },
private val pinUserIdentityResult: (UserId) -> Result<Unit> = { lambdaError() },
private val isUserVerifiedResult: (UserId) -> Result<Boolean> = { lambdaError() },
) : EncryptionService {
private var disableRecoveryFailure: Exception? = null
override val backupStateStateFlow: MutableStateFlow<BackupState> = MutableStateFlow(BackupState.UNKNOWN)
@ -123,6 +124,10 @@ class FakeEncryptionService(
return pinUserIdentityResult(userId)
}
override suspend fun isUserVerified(userId: UserId): Result<Boolean> = simulateLongTask {
isUserVerifiedResult(userId)
}
companion object {
const val FAKE_RECOVERY_KEY = "fake"
}