Use VerificationState.VERIFIED as soon as it's available (#5973)

This can't be a false positive like `VerificationState.UNKNOWN` or `VerificationState.UNVERIFIED`, so it makes sense to return it as fast as possible instead of waiting for the whole encryption layer to be fully loaded.
This commit is contained in:
Jorge Martin Espinosa
2026-01-05 16:06:00 +01:00
committed by GitHub
parent b01135aeef
commit acdbec2de2

View File

@@ -72,7 +72,8 @@ class RustSessionVerificationService(
// Listen for changes in verification status and update accordingly
private val verificationStateListenerTaskHandle = encryptionService.verificationStateListener(object : VerificationStateListener {
override fun onUpdate(status: VerificationState) {
if (!isInitialized.get()) {
// If the status is verified, just use it. It can't be a false positive like unknown or unverified
if (!isInitialized.get() && status != VerificationState.VERIFIED) {
Timber.d("Discarding new verifications state: $status. E2EE is not initialised yet")
return
}