From ada85398982ae23ef0e4926604c6b0c2fd1339f0 Mon Sep 17 00:00:00 2001 From: valere Date: Thu, 1 Jun 2023 19:53:36 +0200 Subject: [PATCH] Fix remove deprecated isReady() call --- .../internal/crypto/verification/RustVerificationService.kt | 5 +++-- .../sdk/internal/crypto/verification/VerificationRequest.kt | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/RustVerificationService.kt b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/RustVerificationService.kt index 8cb6618a18..35965d6f2e 100644 --- a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/RustVerificationService.kt +++ b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/RustVerificationService.kt @@ -36,6 +36,7 @@ import org.matrix.android.sdk.internal.crypto.model.rest.VERIFICATION_METHOD_QR_ import org.matrix.android.sdk.internal.crypto.model.rest.VERIFICATION_METHOD_RECIPROCATE import org.matrix.android.sdk.internal.crypto.model.rest.toValue import org.matrix.android.sdk.internal.session.SessionScope +import org.matrix.rustcomponents.sdk.crypto.VerificationRequestState import timber.log.Timber import javax.inject.Inject @@ -165,7 +166,7 @@ internal class RustVerificationService @Inject constructor( // If this is a SAS verification originating from a `m.key.verification.request` // event, we auto-accept here considering that we either initiated the request or // accepted the request. If it's a QR code verification, just dispatch an update. - if (request.isReady() && transaction is SasVerification) { + if (request.innerState() is VerificationRequestState.Ready && transaction is SasVerification) { // accept() will dispatch an update, no need to do it twice. Timber.d("## Verification: Auto accepting SAS verification with $sender") transaction.accept() @@ -308,7 +309,7 @@ internal class RustVerificationService @Inject constructor( return if (request != null) { request.acceptWithMethods(methods) request.startQrCode() - request.isReady() + request.innerState() is VerificationRequestState.Ready } else { false } diff --git a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/VerificationRequest.kt b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/VerificationRequest.kt index 8d1b3392aa..641bf66c12 100644 --- a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/VerificationRequest.kt +++ b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/VerificationRequest.kt @@ -136,9 +136,9 @@ internal class VerificationRequest @AssistedInject constructor( * concrete verification flow, i.e. we can show/scan a QR code or start emoji * verification. */ - internal fun isReady(): Boolean { - return innerVerificationRequest.isReady() - } +// internal fun isReady(): Boolean { +// return innerVerificationRequest.isReady() +// } /** Did we advertise that we're able to scan QR codes */ internal fun canScanQrCodes(): Boolean {