From 760e14531f31bc4bd6a61ae931c94eddc750bf6e Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 8 Apr 2021 12:09:35 +0200 Subject: [PATCH] Fix EW-EA compatibility for verification --- .../verification/IncomingVerificationRequestHandler.kt | 10 +++++++++- .../vector/app/features/home/HomeActivityViewModel.kt | 5 ++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/crypto/verification/IncomingVerificationRequestHandler.kt b/vector/src/main/java/im/vector/app/features/crypto/verification/IncomingVerificationRequestHandler.kt index fc526b5322..45feaa47c3 100644 --- a/vector/src/main/java/im/vector/app/features/crypto/verification/IncomingVerificationRequestHandler.kt +++ b/vector/src/main/java/im/vector/app/features/crypto/verification/IncomingVerificationRequestHandler.kt @@ -60,7 +60,7 @@ class IncomingVerificationRequestHandler @Inject constructor( // TODO maybe check also if val uid = "kvr_${tx.transactionId}" when (tx.state) { - is VerificationTxState.OnStarted -> { + is VerificationTxState.OnStarted -> { // Add a notification for every incoming request val user = session?.getUser(tx.otherUserId) val name = user?.getBestName() ?: tx.otherUserId @@ -119,6 +119,14 @@ class IncomingVerificationRequestHandler @Inject constructor( Timber.v("## SAS verificationRequestCreated ${pr.transactionId}") // For incoming request we should prompt (if not in activity where this request apply) if (pr.isIncoming) { + + // if it's a self verification for my devices, we can discard the review login alert + // if not this request will be underneath and not visible by the user... + // it will re-appear later + if (pr.otherUserId == session?.myUserId) { + // XXX this is a bit hard coded :/ + popupAlertManager.cancelAlert("review_login") + } val user = session?.getUser(pr.otherUserId)?.toMatrixItem() val name = user?.getBestName() ?: pr.otherUserId val description = if (name == pr.otherUserId) { diff --git a/vector/src/main/java/im/vector/app/features/home/HomeActivityViewModel.kt b/vector/src/main/java/im/vector/app/features/home/HomeActivityViewModel.kt index ad61928509..523898e0f5 100644 --- a/vector/src/main/java/im/vector/app/features/home/HomeActivityViewModel.kt +++ b/vector/src/main/java/im/vector/app/features/home/HomeActivityViewModel.kt @@ -203,9 +203,8 @@ class HomeActivityViewModel @AssistedInject constructor( _viewEvents.post( HomeActivityViewEvents.OnNewSession( session.getUser(session.myUserId)?.toMatrixItem(), - // If it's an old unverified, we should send requests - // instead of waiting for an incoming one - reAuthHelper.data != null + //Always send request instead of waiting for an incoming as per recent EW changes + false ) ) }