mirror of
https://github.com/element-hq/element-android
synced 2024-11-28 13:38:49 +03:00
Rename parameter
This commit is contained in:
parent
f80861bed8
commit
fc04833157
3 changed files with 14 additions and 14 deletions
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -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
|
||||
))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue