From a758efc0182ceaaa36be4a616937a53246633273 Mon Sep 17 00:00:00 2001 From: Valere Date: Fri, 24 Jan 2020 11:32:24 +0100 Subject: [PATCH] Renamed room transport classes --- .../crypto/verification/DefaultVerificationTransaction.kt | 3 +-- .../verification/SASDefaultVerificationTransaction.kt | 2 +- .../{SasTransport.kt => VerificationTransport.kt} | 2 +- ...RoomMessage.kt => VerificationTransportRoomMessage.kt} | 8 ++++---- ...nsportToDevice.kt => VerificationTransportToDevice.kt} | 8 ++++---- 5 files changed, 11 insertions(+), 12 deletions(-) rename matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/{SasTransport.kt => VerificationTransport.kt} (98%) rename matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/{SasTransportRoomMessage.kt => VerificationTransportRoomMessage.kt} (97%) rename matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/{SasTransportToDevice.kt => VerificationTransportToDevice.kt} (96%) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/DefaultVerificationTransaction.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/DefaultVerificationTransaction.kt index d857d278d2..6f06b93b88 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/DefaultVerificationTransaction.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/DefaultVerificationTransaction.kt @@ -15,7 +15,6 @@ */ package im.vector.matrix.android.internal.crypto.verification -import im.vector.matrix.android.api.session.crypto.sas.CancelCode import im.vector.matrix.android.api.session.crypto.sas.VerificationTransaction /** @@ -27,7 +26,7 @@ internal abstract class DefaultVerificationTransaction( override var otherDeviceId: String? = null, override val isIncoming: Boolean) : VerificationTransaction { - lateinit var transport: SasTransport + lateinit var transport: VerificationTransport interface Listener { fun transactionUpdated(tx: VerificationTransaction) diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SASDefaultVerificationTransaction.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SASDefaultVerificationTransaction.kt index d632a06da5..9e78bbb901 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SASDefaultVerificationTransaction.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SASDefaultVerificationTransaction.kt @@ -204,7 +204,7 @@ internal abstract class SASDefaultVerificationTransaction( } override fun isToDeviceTransport(): Boolean { - return transport is SasTransportToDevice + return transport is VerificationTransportToDevice } override fun acceptVerificationEvent(senderId: String, info: VerificationInfo) { 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/VerificationTransport.kt similarity index 98% rename from matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SasTransport.kt rename to matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationTransport.kt index db0728bbc4..b2740ff96b 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/VerificationTransport.kt @@ -23,7 +23,7 @@ import im.vector.matrix.android.api.session.room.model.message.MessageVerificati * SAS verification can be performed using toDevice events or via DM. * This class abstracts the concept of transport for SAS */ -internal interface SasTransport { +internal interface VerificationTransport { /** * Sends a message diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SasTransportRoomMessage.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationTransportRoomMessage.kt similarity index 97% rename from matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SasTransportRoomMessage.kt rename to matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationTransportRoomMessage.kt index 5462fdc960..f36d8a2a8d 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SasTransportRoomMessage.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationTransportRoomMessage.kt @@ -39,7 +39,7 @@ import java.util.* import java.util.concurrent.TimeUnit import javax.inject.Inject -internal class SasTransportRoomMessage( +internal class VerificationTransportRoomMessage( private val workManagerProvider: WorkManagerProvider, private val stringProvider: StringProvider, private val sessionId: String, @@ -49,7 +49,7 @@ internal class SasTransportRoomMessage( private val monarchy: Monarchy, private val localEchoEventFactory: LocalEchoEventFactory, private val tx: DefaultVerificationTransaction? -) : SasTransport { +) : VerificationTransport { override fun sendToOther(type: String, verificationInfo: VerificationInfo, @@ -304,7 +304,7 @@ internal class SasTransportRoomMessageFactory @Inject constructor( private val deviceId: String?, private val localEchoEventFactory: LocalEchoEventFactory) { - fun createTransport(roomId: String, tx: DefaultVerificationTransaction?): SasTransportRoomMessage { - return SasTransportRoomMessage(workManagerProvider, stringProvider, sessionId, userId, deviceId, roomId, monarchy, localEchoEventFactory, tx) + fun createTransport(roomId: String, tx: DefaultVerificationTransaction?): VerificationTransportRoomMessage { + return VerificationTransportRoomMessage(workManagerProvider, stringProvider, sessionId, userId, deviceId, roomId, monarchy, localEchoEventFactory, tx) } } diff --git a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SasTransportToDevice.kt b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationTransportToDevice.kt similarity index 96% rename from matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SasTransportToDevice.kt rename to matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationTransportToDevice.kt index bb3ca7bfa8..04c78d0154 100644 --- a/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/SasTransportToDevice.kt +++ b/matrix-sdk-android/src/main/java/im/vector/matrix/android/internal/crypto/verification/VerificationTransportToDevice.kt @@ -28,11 +28,11 @@ import im.vector.matrix.android.internal.task.configureWith import timber.log.Timber import javax.inject.Inject -internal class SasTransportToDevice( +internal class VerificationTransportToDevice( private var tx: DefaultVerificationTransaction?, private var sendToDeviceTask: SendToDeviceTask, private var taskExecutor: TaskExecutor -) : SasTransport { +) : VerificationTransport { override fun sendVerificationRequest(supportedMethods: List, localID: String, @@ -149,7 +149,7 @@ internal class SasTransportToDeviceFactory @Inject constructor( private val sendToDeviceTask: SendToDeviceTask, private val taskExecutor: TaskExecutor) { - fun createTransport(tx: DefaultVerificationTransaction?): SasTransportToDevice { - return SasTransportToDevice(tx, sendToDeviceTask, taskExecutor) + fun createTransport(tx: DefaultVerificationTransaction?): VerificationTransportToDevice { + return VerificationTransportToDevice(tx, sendToDeviceTask, taskExecutor) } }