Rename parameter

This commit is contained in:
Benoit Marty 2020-01-27 11:22:30 +01:00
parent f80861bed8
commit fc04833157
3 changed files with 14 additions and 14 deletions

View file

@ -19,10 +19,10 @@ package im.vector.riotx.features.crypto.verification
import im.vector.riotx.core.platform.VectorViewModelAction
sealed class VerificationAction : VectorViewModelAction {
data class RequestVerificationByDM(val userID: String, val roomId: String?) : VerificationAction()
data class StartSASVerification(val userID: String, val pendingRequestTransactionId: String) : VerificationAction()
data class RemoteQrCodeScanned(val userID: String, val transactionId: String, val scannedData: String) : VerificationAction()
data class SASMatchAction(val userID: String, val sasTransactionId: String) : VerificationAction()
data class SASDoNotMatchAction(val userID: String, val sasTransactionId: String) : VerificationAction()
data class RequestVerificationByDM(val otherUserId: String, val roomId: String?) : VerificationAction()
data class StartSASVerification(val otherUserId: String, val pendingRequestTransactionId: String) : VerificationAction()
data class RemoteQrCodeScanned(val otherUserId: String, val transactionId: String, val scannedData: String) : VerificationAction()
data class SASMatchAction(val otherUserId: String, val sasTransactionId: String) : VerificationAction()
data class SASDoNotMatchAction(val otherUserId: String, val sasTransactionId: String) : VerificationAction()
object GotItConclusion : VerificationAction()
}

View file

@ -166,18 +166,18 @@ class VerificationBottomSheetViewModel @AssistedInject constructor(@Assisted ini
}
is VerificationAction.RemoteQrCodeScanned -> {
val existingTransaction = session.getVerificationService()
.getExistingTransaction(action.userID, action.transactionId) as? QRVerificationTransaction
.getExistingTransaction(action.otherUserId, action.transactionId) as? QRVerificationTransaction
existingTransaction
?.userHasScannedRemoteQrCode(action.scannedData)
}
is VerificationAction.SASMatchAction -> {
(session.getVerificationService()
.getExistingTransaction(action.userID, action.sasTransactionId)
.getExistingTransaction(action.otherUserId, action.sasTransactionId)
as? SasVerificationTransaction)?.userHasVerifiedShortCode()
}
is VerificationAction.SASDoNotMatchAction -> {
(session.getVerificationService()
.getExistingTransaction(action.userID, action.sasTransactionId)
.getExistingTransaction(action.otherUserId, action.sasTransactionId)
as? SasVerificationTransaction)
?.shortCodeDoesNotMatch()
}

View file

@ -69,10 +69,10 @@ class VerificationChooseMethodFragment @Inject constructor(
controller.update(state)
}
override fun doVerifyBySas() = withState(sharedViewModel) {
override fun doVerifyBySas() = withState(sharedViewModel) { state ->
sharedViewModel.handle(VerificationAction.StartSASVerification(
it.otherUserMxItem?.id ?: "",
it.pendingRequest.invoke()?.transactionId ?: ""))
state.otherUserMxItem?.id ?: "",
state.pendingRequest.invoke()?.transactionId ?: ""))
}
override fun openCamera() {
@ -112,10 +112,10 @@ class VerificationChooseMethodFragment @Inject constructor(
}
}
private fun onRemoteQrCodeScanned(remoteQrCode: String) = withState(sharedViewModel) {
private fun onRemoteQrCodeScanned(remoteQrCode: String) = withState(sharedViewModel) { state ->
sharedViewModel.handle(VerificationAction.RemoteQrCodeScanned(
it.otherUserMxItem?.id ?: "",
it.pendingRequest.invoke()?.transactionId ?: "",
state.otherUserMxItem?.id ?: "",
state.pendingRequest.invoke()?.transactionId ?: "",
remoteQrCode
))
}