From f68e84d9da0715a518312d7c54bfedd1fd33e62f Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 16 Apr 2020 12:56:52 +0200 Subject: [PATCH 1/2] Update toaster to match web --- .../java/im/vector/riotx/features/home/HomeDetailFragment.kt | 2 +- vector/src/main/res/values/strings.xml | 2 +- vector/src/main/res/values/strings_riotX.xml | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt index 47338f6335..564b030081 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/HomeDetailFragment.kt @@ -102,7 +102,7 @@ class HomeDetailFragment @Inject constructor( VerificationVectorAlert( uid = uid, title = getString(R.string.new_session), - description = getString(R.string.new_session_review), + description = getString(R.string.new_session_review_with_info, newest.displayName ?: "", newest.deviceId ?: ""), iconId = R.drawable.ic_shield_warning ).apply { matrixItem = user diff --git a/vector/src/main/res/values/strings.xml b/vector/src/main/res/values/strings.xml index 17986addb5..c95518395f 100644 --- a/vector/src/main/res/values/strings.xml +++ b/vector/src/main/res/values/strings.xml @@ -2202,7 +2202,7 @@ Not all features in Riot are implemented in RiotX yet. Main missing (and coming Refresh - New Session + Unverified login. Was this you? Tap to review & verify Use this session to verify your new one, granting it access to encrypted messages. This wasn’t me diff --git a/vector/src/main/res/values/strings_riotX.xml b/vector/src/main/res/values/strings_riotX.xml index 807d94112d..90496c351d 100644 --- a/vector/src/main/res/values/strings_riotX.xml +++ b/vector/src/main/res/values/strings_riotX.xml @@ -28,6 +28,8 @@ Generating SSSS key from passphrase (%s) Generating SSSS key from recovery key Storing keybackup secret in SSSS + + %1$s (%2$s) From 66fc38ad4bd17c10a257a511b25404a0b42f8b73 Mon Sep 17 00:00:00 2001 From: Valere Date: Thu, 16 Apr 2020 12:57:07 +0200 Subject: [PATCH 2/2] Remove GlobalScope usage --- .../crypto/verification/DefaultVerificationService.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/DefaultVerificationService.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/DefaultVerificationService.kt index 77dcc483bd..04a3560223 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/DefaultVerificationService.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/DefaultVerificationService.kt @@ -82,6 +82,7 @@ import im.vector.matrix.android.internal.di.DeviceId import im.vector.matrix.android.internal.di.UserId import im.vector.matrix.android.internal.session.SessionScope import im.vector.matrix.android.internal.util.MatrixCoroutineDispatchers +import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.launch import timber.log.Timber @@ -102,7 +103,8 @@ internal class DefaultVerificationService @Inject constructor( private val coroutineDispatchers: MatrixCoroutineDispatchers, private val verificationTransportRoomMessageFactory: VerificationTransportRoomMessageFactory, private val verificationTransportToDeviceFactory: VerificationTransportToDeviceFactory, - private val crossSigningService: CrossSigningService + private val crossSigningService: CrossSigningService, + private val cryptoCoroutineScope: CoroutineScope ) : DefaultVerificationTransaction.Listener, VerificationService { private val uiHandler = Handler(Looper.getMainLooper()) @@ -125,7 +127,7 @@ internal class DefaultVerificationService @Inject constructor( // Event received from the sync fun onToDeviceEvent(event: Event) { - GlobalScope.launch(coroutineDispatchers.crypto) { + cryptoCoroutineScope.launch(coroutineDispatchers.crypto) { when (event.getClearType()) { EventType.KEY_VERIFICATION_START -> { onStartRequestReceived(event)