Fix API break.

This commit is contained in:
Benoit Marty 2024-10-28 21:05:26 +01:00
parent 84ef1de537
commit 1eea8d6c11

View file

@ -35,6 +35,7 @@ import org.matrix.rustcomponents.sdk.RecoveryState
import org.matrix.rustcomponents.sdk.RecoveryStateListener import org.matrix.rustcomponents.sdk.RecoveryStateListener
import org.matrix.rustcomponents.sdk.SessionVerificationController import org.matrix.rustcomponents.sdk.SessionVerificationController
import org.matrix.rustcomponents.sdk.SessionVerificationControllerDelegate import org.matrix.rustcomponents.sdk.SessionVerificationControllerDelegate
import org.matrix.rustcomponents.sdk.SessionVerificationRequestDetails
import org.matrix.rustcomponents.sdk.VerificationState import org.matrix.rustcomponents.sdk.VerificationState
import org.matrix.rustcomponents.sdk.VerificationStateListener import org.matrix.rustcomponents.sdk.VerificationStateListener
import org.matrix.rustcomponents.sdk.use import org.matrix.rustcomponents.sdk.use
@ -150,7 +151,7 @@ class RustSessionVerificationService(
// It also sometimes unexpectedly fails to report the session as verified, so we have to handle that possibility and fail if needed // It also sometimes unexpectedly fails to report the session as verified, so we have to handle that possibility and fail if needed
runCatching { runCatching {
withTimeout(30.seconds) { withTimeout(30.seconds) {
while (!verificationController.isVerified()) { while (encryptionService.verificationState() != VerificationState.VERIFIED) {
delay(100) delay(100)
} }
} }
@ -176,6 +177,10 @@ class RustSessionVerificationService(
_verificationFlowState.value = VerificationFlowState.StartedSasVerification _verificationFlowState.value = VerificationFlowState.StartedSasVerification
} }
override fun didReceiveVerificationRequest(details: SessionVerificationRequestDetails) {
// TODO
}
// end-region // end-region
override suspend fun reset() { override suspend fun reset() {
@ -227,7 +232,7 @@ class RustSessionVerificationService(
Timber.d("Updating verification status: flow is pending or was finished some time ago") Timber.d("Updating verification status: flow is pending or was finished some time ago")
runCatching { runCatching {
initVerificationControllerIfNeeded() initVerificationControllerIfNeeded()
_sessionVerifiedStatus.value = if (verificationController.isVerified()) { _sessionVerifiedStatus.value = if (encryptionService.verificationState() == VerificationState.VERIFIED) {
SessionVerifiedStatus.Verified SessionVerifiedStatus.Verified
} else { } else {
SessionVerifiedStatus.NotVerified SessionVerifiedStatus.NotVerified