diff --git a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/verification/RustSessionVerificationService.kt b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/verification/RustSessionVerificationService.kt index 95ae68de44..3c3aeb7bcb 100644 --- a/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/verification/RustSessionVerificationService.kt +++ b/libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/verification/RustSessionVerificationService.kt @@ -57,6 +57,12 @@ class RustSessionVerificationService( private val encryptionService: Encryption = client.encryption() private lateinit var verificationController: SessionVerificationController + private val _verificationFlowState = MutableStateFlow(VerificationFlowState.Initial) + override val verificationFlowState = _verificationFlowState.asStateFlow() + + private val _sessionVerifiedStatus = MutableStateFlow(SessionVerifiedStatus.Unknown) + override val sessionVerifiedStatus: StateFlow = _sessionVerifiedStatus.asStateFlow() + // Listen for changes in verification status and update accordingly private val verificationStateListenerTaskHandle = encryptionService.verificationStateListener(object : VerificationStateListener { override fun onUpdate(status: VerificationState) { @@ -74,12 +80,6 @@ class RustSessionVerificationService( } }) - private val _verificationFlowState = MutableStateFlow(VerificationFlowState.Initial) - override val verificationFlowState = _verificationFlowState.asStateFlow() - - private val _sessionVerifiedStatus = MutableStateFlow(SessionVerifiedStatus.Unknown) - override val sessionVerifiedStatus: StateFlow = _sessionVerifiedStatus.asStateFlow() - /** * The internal service that checks verification can only run after the initial sync. * This [StateFlow] will notify consumers when the service is ready to be used.