mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 21:32:34 +00:00
Merge pull request #6726 from element-hq/feature/bma/renameVerificationMethod
Rename verification methods
This commit is contained in:
+3
-3
@@ -33,7 +33,7 @@ interface SessionVerificationService {
|
||||
/**
|
||||
* Request verification of the current session.
|
||||
*/
|
||||
suspend fun requestCurrentSessionVerification()
|
||||
suspend fun requestDeviceVerification()
|
||||
|
||||
/**
|
||||
* Request verification of the user with the given [userId].
|
||||
@@ -56,9 +56,9 @@ interface SessionVerificationService {
|
||||
suspend fun declineVerification()
|
||||
|
||||
/**
|
||||
* Starts the verification of the unverified session from another device.
|
||||
* Transition the current verification request into a SAS verification flow.
|
||||
*/
|
||||
suspend fun startVerification()
|
||||
suspend fun startSasVerification()
|
||||
|
||||
/**
|
||||
* Returns the verification service state to the initial step.
|
||||
|
||||
+2
-2
@@ -124,7 +124,7 @@ class RustSessionVerificationService(
|
||||
this.listener = listener
|
||||
}
|
||||
|
||||
override suspend fun requestCurrentSessionVerification() = tryOrFail {
|
||||
override suspend fun requestDeviceVerification() = tryOrFail {
|
||||
ensureEncryptionIsInitialized()
|
||||
verificationController.requestDeviceVerification()
|
||||
currentVerificationRequest = VerificationRequest.Outgoing.CurrentSession
|
||||
@@ -146,7 +146,7 @@ class RustSessionVerificationService(
|
||||
|
||||
override suspend fun declineVerification() = tryOrFail { verificationController.declineVerification() }
|
||||
|
||||
override suspend fun startVerification() = tryOrFail {
|
||||
override suspend fun startSasVerification() = tryOrFail {
|
||||
verificationController.startSasVerification()
|
||||
}
|
||||
|
||||
|
||||
+12
-12
@@ -22,12 +22,12 @@ import kotlinx.coroutines.flow.StateFlow
|
||||
|
||||
class FakeSessionVerificationService(
|
||||
initialSessionVerifiedStatus: SessionVerifiedStatus = SessionVerifiedStatus.Unknown,
|
||||
private val requestCurrentSessionVerificationLambda: () -> Unit = { lambdaError() },
|
||||
private val requestDeviceVerificationLambda: () -> Unit = { lambdaError() },
|
||||
private val requestUserVerificationLambda: (UserId) -> Unit = { lambdaError() },
|
||||
private val cancelVerificationLambda: () -> Unit = { lambdaError() },
|
||||
private val approveVerificationLambda: () -> Unit = { lambdaError() },
|
||||
private val declineVerificationLambda: () -> Unit = { lambdaError() },
|
||||
private val startVerificationLambda: () -> Unit = { lambdaError() },
|
||||
private val startSasVerificationLambda: () -> Unit = { lambdaError() },
|
||||
private val resetLambda: (Boolean) -> Unit = { lambdaError() },
|
||||
private val acknowledgeVerificationRequestLambda: (VerificationRequest.Incoming) -> Unit = { lambdaError() },
|
||||
private val acceptVerificationRequestLambda: () -> Unit = { lambdaError() },
|
||||
@@ -40,31 +40,31 @@ class FakeSessionVerificationService(
|
||||
override val sessionVerifiedStatus: StateFlow<SessionVerifiedStatus> = _sessionVerifiedStatus
|
||||
override val needsSessionVerification: Flow<Boolean> = _needsSessionVerification
|
||||
|
||||
override suspend fun requestCurrentSessionVerification() {
|
||||
requestCurrentSessionVerificationLambda()
|
||||
override suspend fun requestDeviceVerification() = simulateLongTask {
|
||||
requestDeviceVerificationLambda()
|
||||
}
|
||||
|
||||
override suspend fun requestUserVerification(userId: UserId) {
|
||||
override suspend fun requestUserVerification(userId: UserId) = simulateLongTask {
|
||||
requestUserVerificationLambda(userId)
|
||||
}
|
||||
|
||||
override suspend fun cancelVerification() {
|
||||
override suspend fun cancelVerification() = simulateLongTask {
|
||||
cancelVerificationLambda()
|
||||
}
|
||||
|
||||
override suspend fun approveVerification() {
|
||||
override suspend fun approveVerification() = simulateLongTask {
|
||||
approveVerificationLambda()
|
||||
}
|
||||
|
||||
override suspend fun declineVerification() {
|
||||
override suspend fun declineVerification() = simulateLongTask {
|
||||
declineVerificationLambda()
|
||||
}
|
||||
|
||||
override suspend fun startVerification() {
|
||||
startVerificationLambda()
|
||||
override suspend fun startSasVerification() = simulateLongTask {
|
||||
startSasVerificationLambda()
|
||||
}
|
||||
|
||||
override suspend fun reset(cancelAnyPendingVerificationAttempt: Boolean) {
|
||||
override suspend fun reset(cancelAnyPendingVerificationAttempt: Boolean) = simulateLongTask {
|
||||
resetLambda(cancelAnyPendingVerificationAttempt)
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ class FakeSessionVerificationService(
|
||||
this.listener = listener
|
||||
}
|
||||
|
||||
override suspend fun acknowledgeVerificationRequest(verificationRequest: VerificationRequest.Incoming) {
|
||||
override suspend fun acknowledgeVerificationRequest(verificationRequest: VerificationRequest.Incoming) = simulateLongTask {
|
||||
acknowledgeVerificationRequestLambda(verificationRequest)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user