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:
parent
b01135aeef
commit
acdbec2de2
1 changed files with 2 additions and 1 deletions
|
|
@ -72,7 +72,8 @@ class RustSessionVerificationService(
|
||||||
// Listen for changes in verification status and update accordingly
|
// Listen for changes in verification status and update accordingly
|
||||||
private val verificationStateListenerTaskHandle = encryptionService.verificationStateListener(object : VerificationStateListener {
|
private val verificationStateListenerTaskHandle = encryptionService.verificationStateListener(object : VerificationStateListener {
|
||||||
override fun onUpdate(status: VerificationState) {
|
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")
|
Timber.d("Discarding new verifications state: $status. E2EE is not initialised yet")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue