From e420070066a8ba94843204f70a44435261ee866b Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 6 Mar 2020 13:40:35 +0100 Subject: [PATCH] Rename to respect naming convention --- .../matrix/android/internal/crypto/verification/SASTest.kt | 2 +- .../room/model/message/MessageVerificationAcceptContent.kt | 2 +- .../room/model/message/MessageVerificationCancelContent.kt | 2 +- .../room/model/message/MessageVerificationDoneContent.kt | 4 ++-- .../room/model/message/MessageVerificationKeyContent.kt | 2 +- .../room/model/message/MessageVerificationMacContent.kt | 2 +- .../room/model/message/MessageVerificationReadyContent.kt | 2 +- .../room/model/message/MessageVerificationRequestContent.kt | 2 +- .../room/model/message/MessageVerificationStartContent.kt | 2 +- .../internal/crypto/model/rest/KeyVerificationAccept.kt | 5 ++--- .../internal/crypto/model/rest/KeyVerificationCancel.kt | 2 +- .../internal/crypto/model/rest/KeyVerificationDone.kt | 2 +- .../android/internal/crypto/model/rest/KeyVerificationKey.kt | 2 +- .../android/internal/crypto/model/rest/KeyVerificationMac.kt | 2 +- .../internal/crypto/model/rest/KeyVerificationReady.kt | 2 +- .../internal/crypto/model/rest/KeyVerificationRequest.kt | 2 +- .../internal/crypto/model/rest/KeyVerificationStart.kt | 2 +- .../android/internal/crypto/verification/VerificationInfo.kt | 2 +- .../internal/crypto/verification/VerificationInfoAccept.kt | 2 +- .../internal/crypto/verification/VerificationInfoCancel.kt | 2 +- .../internal/crypto/verification/VerificationInfoDone.kt | 2 +- .../internal/crypto/verification/VerificationInfoKey.kt | 2 +- .../internal/crypto/verification/VerificationInfoMac.kt | 2 +- .../internal/crypto/verification/VerificationInfoReady.kt | 2 +- .../internal/crypto/verification/VerificationInfoRequest.kt | 2 +- .../internal/crypto/verification/VerificationInfoStart.kt | 2 +- .../crypto/verification/VerificationTransportToDevice.kt | 4 ++-- 27 files changed, 30 insertions(+), 31 deletions(-) diff --git a/matrix-sdk-android/src/androidTest/java/im/vector/matrix/android/internal/crypto/verification/SASTest.kt b/matrix-sdk-android/src/androidTest/java/im/vector/matrix/android/internal/crypto/verification/SASTest.kt index b0734c2cb5..eefb040987 100644 --- a/matrix-sdk-android/src/androidTest/java/im/vector/matrix/android/internal/crypto/verification/SASTest.kt +++ b/matrix-sdk-android/src/androidTest/java/im/vector/matrix/android/internal/crypto/verification/SASTest.kt @@ -278,7 +278,7 @@ class SASTest : InstrumentedTest { val startMessage = KeyVerificationStart( fromDevice = bobSession.cryptoService().getMyDevice().deviceId, method = VerificationMethod.SAS.toValue(), - transactionID = tid, + transactionId = tid, keyAgreementProtocols = protocols, hashes = hashes, messageAuthenticationCodes = mac, diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationAcceptContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationAcceptContent.kt index 95088d0f75..074776bc34 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationAcceptContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationAcceptContent.kt @@ -33,7 +33,7 @@ internal data class MessageVerificationAcceptContent( @Json(name = "commitment") override var commitment: String? = null ) : VerificationInfoAccept { - override val transactionID: String? + override val transactionId: String? get() = relatesTo?.eventId override fun toEventContent() = toContent() diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationCancelContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationCancelContent.kt index 5cfef097c1..aa72bfe272 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationCancelContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationCancelContent.kt @@ -30,7 +30,7 @@ data class MessageVerificationCancelContent( @Json(name = "m.relates_to") val relatesTo: RelationDefaultContent? ) : VerificationInfoCancel { - override val transactionID: String? + override val transactionId: String? get() = relatesTo?.eventId override fun toEventContent() = toContent() diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationDoneContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationDoneContent.kt index c8c8b1d0e3..e102f9f4f4 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationDoneContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationDoneContent.kt @@ -27,13 +27,13 @@ internal data class MessageVerificationDoneContent( @Json(name = "m.relates_to") val relatesTo: RelationDefaultContent? ) : VerificationInfo { - override val transactionID: String? + override val transactionId: String? get() = relatesTo?.eventId override fun toEventContent(): Content? = toContent() override fun asValidObject(): ValidVerificationDone? { - val validTransactionId = transactionID?.takeIf { it.isNotEmpty() } ?: return null + val validTransactionId = transactionId?.takeIf { it.isNotEmpty() } ?: return null return ValidVerificationDone( validTransactionId diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationKeyContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationKeyContent.kt index 7a4b95f339..cfd3f438b8 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationKeyContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationKeyContent.kt @@ -32,7 +32,7 @@ internal data class MessageVerificationKeyContent( @Json(name = "m.relates_to") val relatesTo: RelationDefaultContent? ) : VerificationInfoKey { - override val transactionID: String? + override val transactionId: String? get() = relatesTo?.eventId override fun toEventContent() = toContent() diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationMacContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationMacContent.kt index 1d732bf605..043e89cc38 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationMacContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationMacContent.kt @@ -30,7 +30,7 @@ internal data class MessageVerificationMacContent( @Json(name = "m.relates_to") val relatesTo: RelationDefaultContent? ) : VerificationInfoMac { - override val transactionID: String? + override val transactionId: String? get() = relatesTo?.eventId override fun toEventContent() = toContent() diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationReadyContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationReadyContent.kt index d4b7e728ab..da16d21c1a 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationReadyContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationReadyContent.kt @@ -30,7 +30,7 @@ internal data class MessageVerificationReadyContent( @Json(name = "m.relates_to") val relatesTo: RelationDefaultContent? ) : VerificationInfoReady { - override val transactionID: String? + override val transactionId: String? get() = relatesTo?.eventId override fun toEventContent() = toContent() diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationRequestContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationRequestContent.kt index 340dea1c07..5010982e8b 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationRequestContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationRequestContent.kt @@ -35,7 +35,7 @@ data class MessageVerificationRequestContent( @Json(name = "m.relates_to") override val relatesTo: RelationDefaultContent? = null, @Json(name = "m.new_content") override val newContent: Content? = null, // Not parsed, but set after, using the eventId - override val transactionID: String? = null + override val transactionId: String? = null ) : MessageContent, VerificationInfoRequest { override fun toEventContent() = toContent() diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationStartContent.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationStartContent.kt index 7d7eb47523..1db65d8888 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationStartContent.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/api/session/room/model/message/MessageVerificationStartContent.kt @@ -38,7 +38,7 @@ internal data class MessageVerificationStartContent( return JsonCanonicalizer.getCanonicalJson(MessageVerificationStartContent::class.java, this) } - override val transactionID: String? + override val transactionId: String? get() = relatesTo?.eventId override fun toEventContent() = toContent() diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationAccept.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationAccept.kt index 1aa45040e3..2168ac3b04 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationAccept.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationAccept.kt @@ -25,14 +25,13 @@ import im.vector.matrix.android.internal.crypto.verification.VerificationInfoAcc */ @JsonClass(generateAdapter = true) internal data class KeyVerificationAccept( - /** * string to identify the transaction. * This string must be unique for the pair of users performing verification for the duration that the transaction is valid. * Alice’s device should record this ID and use it in future messages in this transaction. */ @Json(name = "transaction_id") - override val transactionID: String? = null, + override val transactionId: String? = null, /** * The key agreement protocol that Bob’s device has selected to use, out of the list proposed by Alice’s device @@ -76,7 +75,7 @@ internal data class KeyVerificationAccept( messageAuthenticationCode: String, shortAuthenticationStrings: List): VerificationInfoAccept { return KeyVerificationAccept( - transactionID = tid, + transactionId = tid, keyAgreementProtocol = keyAgreementProtocol, hash = hash, commitment = commitment, diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationCancel.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationCancel.kt index 6f940fd328..e1bf84ea92 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationCancel.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationCancel.kt @@ -29,7 +29,7 @@ internal data class KeyVerificationCancel( * the transaction ID of the verification to cancel */ @Json(name = "transaction_id") - override val transactionID: String? = null, + override val transactionId: String? = null, /** * machine-readable reason for cancelling, see #CancelCode diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationDone.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationDone.kt index eaaf8b8281..1456183a55 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationDone.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationDone.kt @@ -24,7 +24,7 @@ import im.vector.matrix.android.internal.crypto.verification.VerificationInfoDon */ @JsonClass(generateAdapter = true) internal data class KeyVerificationDone( - @Json(name = "transaction_id") override val transactionID: String? = null + @Json(name = "transaction_id") override val transactionId: String? = null ) : SendToDeviceObject, VerificationInfoDone { override fun toSendToDeviceObject() = this diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationKey.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationKey.kt index a3baed8558..55450ceaf1 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationKey.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationKey.kt @@ -28,7 +28,7 @@ internal data class KeyVerificationKey( /** * the ID of the transaction that the message is part of */ - @Json(name = "transaction_id") override val transactionID: String? = null, + @Json(name = "transaction_id") override val transactionId: String? = null, /** * The device’s ephemeral public key, as an unpadded base64 string diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationMac.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationMac.kt index a72a7cbc64..19e9176299 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationMac.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationMac.kt @@ -25,7 +25,7 @@ import im.vector.matrix.android.internal.crypto.verification.VerificationInfoMac */ @JsonClass(generateAdapter = true) internal data class KeyVerificationMac( - @Json(name = "transaction_id") override val transactionID: String? = null, + @Json(name = "transaction_id") override val transactionId: String? = null, @Json(name = "mac") override val mac: Map? = null, @Json(name = "keys") override val keys: String? = null diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationReady.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationReady.kt index 9050cbd908..fea01fd345 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationReady.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationReady.kt @@ -26,7 +26,7 @@ import im.vector.matrix.android.internal.crypto.verification.VerificationInfoRea internal data class KeyVerificationReady( @Json(name = "from_device") override val fromDevice: String?, @Json(name = "methods") override val methods: List?, - @Json(name = "transaction_id") override val transactionID: String? = null + @Json(name = "transaction_id") override val transactionId: String? = null ) : SendToDeviceObject, VerificationInfoReady { override fun toSendToDeviceObject() = this diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationRequest.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationRequest.kt index dca359aece..ed21747f27 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationRequest.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationRequest.kt @@ -27,7 +27,7 @@ internal data class KeyVerificationRequest( @Json(name = "from_device") override val fromDevice: String?, @Json(name = "methods") override val methods: List, @Json(name = "timestamp") override val timestamp: Long?, - @Json(name = "transaction_id") override val transactionID: String? = null + @Json(name = "transaction_id") override val transactionId: String? = null ) : SendToDeviceObject, VerificationInfoRequest { override fun toSendToDeviceObject() = this diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationStart.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationStart.kt index 4872e126c8..a410a14dfe 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationStart.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/model/rest/KeyVerificationStart.kt @@ -27,7 +27,7 @@ import im.vector.matrix.android.internal.util.JsonCanonicalizer internal data class KeyVerificationStart( @Json(name = "from_device") override val fromDevice: String? = null, @Json(name = "method") override val method: String? = null, - @Json(name = "transaction_id") override val transactionID: String? = null, + @Json(name = "transaction_id") override val transactionId: String? = null, @Json(name = "key_agreement_protocols") override val keyAgreementProtocols: List? = null, @Json(name = "hashes") override val hashes: List? = null, @Json(name = "message_authentication_codes") override val messageAuthenticationCodes: List? = null, diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfo.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfo.kt index 6af6b59bf6..d3d448236e 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfo.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfo.kt @@ -29,5 +29,5 @@ interface VerificationInfo { * This string must be unique for the pair of users performing verification for the duration that the transaction is valid. * Alice’s device should record this ID and use it in future messages in this transaction. */ - val transactionID: String? + val transactionId: String? } diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfoAccept.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfoAccept.kt index 79550d8c1b..1997f85bec 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfoAccept.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfoAccept.kt @@ -43,7 +43,7 @@ internal interface VerificationInfoAccept : VerificationInfo { override fun asValidObject(): ValidVerificationInfoDone? { - if (transactionID.isNullOrBlank()) { + if (transactionId.isNullOrEmpty()) { return null } return ValidVerificationInfoDone diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfoKey.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfoKey.kt index 07c3f948e9..d093cb3fac 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfoKey.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfoKey.kt @@ -25,7 +25,7 @@ internal interface VerificationInfoKey : VerificationInfo? override fun asValidObject(): ValidVerificationInfoReady? { - val validTransactionId = transactionID?.takeIf { it.isNotEmpty() } ?: return null + val validTransactionId = transactionId?.takeIf { it.isNotEmpty() } ?: return null val validFromDevice = fromDevice?.takeIf { it.isNotEmpty() } ?: return null val validMethods = methods?.takeIf { it.isNotEmpty() } ?: return null diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfoRequest.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfoRequest.kt index 58a95e8a06..63172e8286 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfoRequest.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationInfoRequest.kt @@ -38,7 +38,7 @@ internal interface VerificationInfoRequest : VerificationInfo): VerificationInfoReady { return KeyVerificationReady( - transactionID = tid, + transactionId = tid, fromDevice = fromDevice, methods = methods )