mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 05:31:21 +03:00
Support SCAN method (WIP)
This commit is contained in:
parent
37b950897f
commit
b3089343ad
6 changed files with 17 additions and 11 deletions
|
@ -31,9 +31,9 @@ class SharedSecretTest : InstrumentedTest {
|
|||
|
||||
@Test
|
||||
fun testSharedSecretLengthCase() {
|
||||
val sharedSecret = generateSharedSecret()
|
||||
|
||||
sharedSecret.length shouldBe 43
|
||||
repeat(100) {
|
||||
generateSharedSecret().length shouldBe 43
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -21,6 +21,5 @@ package im.vector.matrix.android.api.session.crypto.sas
|
|||
*/
|
||||
enum class VerificationMethod {
|
||||
SAS,
|
||||
// Not supported yet
|
||||
SCAN
|
||||
}
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -37,8 +37,8 @@ internal interface SasTransport {
|
|||
fun sendVerificationRequest(supportedMethods: List<String>,
|
||||
localID: String,
|
||||
otherUserId: String,
|
||||
roomId: String, callback:
|
||||
(String?, MessageVerificationRequestContent?) -> Unit)
|
||||
roomId: String,
|
||||
callback: (String?, MessageVerificationRequestContent?) -> Unit)
|
||||
|
||||
fun cancelTransaction(transactionId: String,
|
||||
otherUserId: String,
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue