diff --git a/matrix-sdk-android/src/androidTest/java/im/vector/matrix/android/internal/crypto/verification/qrcode/SharedSecretTest.kt b/matrix-sdk-android/src/androidTest/java/im/vector/matrix/android/internal/crypto/verification/qrcode/SharedSecretTest.kt index 845d6f269a..7a07c16d14 100644 --- a/matrix-sdk-android/src/androidTest/java/im/vector/matrix/android/internal/crypto/verification/qrcode/SharedSecretTest.kt +++ b/matrix-sdk-android/src/androidTest/java/im/vector/matrix/android/internal/crypto/verification/qrcode/SharedSecretTest.kt @@ -31,9 +31,9 @@ class SharedSecretTest : InstrumentedTest { @Test fun testSharedSecretLengthCase() { - val sharedSecret = generateSharedSecret() - - sharedSecret.length shouldBe 43 + repeat(100) { + generateSharedSecret().length shouldBe 43 + } } @Test diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/crypto/sas/VerificationMethod.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/crypto/sas/VerificationMethod.kt index a2dd90bc84..8b65dd5645 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/crypto/sas/VerificationMethod.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/crypto/sas/VerificationMethod.kt @@ -21,6 +21,5 @@ package im.vector.matrix.android.api.session.crypto.sas */ enum class VerificationMethod { SAS, - // Not supported yet SCAN } diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/VerificationMethodValues.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/VerificationMethodValues.kt index 168a8c8f48..04fb76bedd 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/VerificationMethodValues.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/VerificationMethodValues.kt @@ -28,5 +28,8 @@ internal fun VerificationMethod.toValue(): String { } } -// TODO Add SCAN -internal val supportedVerificationMethods = listOf(VERIFICATION_METHOD_SAS) +internal val supportedVerificationMethods = + listOf( + VERIFICATION_METHOD_SAS, + VERIFICATION_METHOD_SCAN + ) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SasTransport.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SasTransport.kt index 12fe5c338f..2e6d5ed32a 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SasTransport.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SasTransport.kt @@ -37,8 +37,8 @@ internal interface SasTransport { fun sendVerificationRequest(supportedMethods: List, localID: String, otherUserId: String, - roomId: String, callback: - (String?, MessageVerificationRequestContent?) -> Unit) + roomId: String, + callback: (String?, MessageVerificationRequestContent?) -> Unit) fun cancelTransaction(transactionId: String, otherUserId: String, diff --git a/vector/src/main/java/im/vector/riotx/features/crypto/verification/Config.kt b/vector/src/main/java/im/vector/riotx/features/crypto/verification/Config.kt index 0bc9a3e144..0e9011d532 100644 --- a/vector/src/main/java/im/vector/riotx/features/crypto/verification/Config.kt +++ b/vector/src/main/java/im/vector/riotx/features/crypto/verification/Config.kt @@ -18,5 +18,8 @@ package im.vector.riotx.features.crypto.verification import im.vector.matrix.android.api.session.crypto.sas.VerificationMethod -// TODO Add support for SCAN (QR code) -val supportedVerificationMethods = listOf(VerificationMethod.SAS) +val supportedVerificationMethods = + listOf( + VerificationMethod.SAS, + VerificationMethod.SCAN + ) diff --git a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt index 236dd19030..688699c9af 100644 --- a/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/home/room/detail/RoomDetailFragment.kt @@ -1027,7 +1027,8 @@ class RoomDetailFragment @Inject constructor( } override fun onAvatarClicked(informationData: MessageInformationData) { - openRoomMemberProfile(informationData.senderId) + // DO NOT COMMIT openRoomMemberProfile(informationData.senderId) + roomDetailViewModel.handle(RoomDetailAction.RequestVerification(informationData.senderId)) } private fun openRoomMemberProfile(userId: String) {