Skip to content

Commit 8955fb1

Browse files
authored
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.
1 parent 7186044 commit 8955fb1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/verification/RustSessionVerificationService.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ class RustSessionVerificationService(
7272
// Listen for changes in verification status and update accordingly
7373
private val verificationStateListenerTaskHandle = encryptionService.verificationStateListener(object : VerificationStateListener {
7474
override fun onUpdate(status: VerificationState) {
75-
if (!isInitialized.get()) {
75+
// If the status is verified, just use it. It can't be a false positive like unknown or unverified
76+
if (!isInitialized.get() && status != VerificationState.VERIFIED) {
7677
Timber.d("Discarding new verifications state: $status. E2EE is not initialised yet")
7778
return
7879
}

0 commit comments

Comments
 (0)