QrCode: WIP
This commit is contained in:
parent
f46023e84c
commit
69ab5e43d5
|
@ -27,9 +27,9 @@ enum class CancelCode(val value: String, val humanReadable: String) {
|
|||
UnexpectedMessage("m.unexpected_message", "the device received an unexpected message"),
|
||||
InvalidMessage("m.invalid_message", "an invalid message was received"),
|
||||
MismatchedKeys("m.key_mismatch", "Key mismatch"),
|
||||
UserError("m.user_error", "User mismatch"),
|
||||
UserMismatchError("m.user_mismatch", "Key mismatch"),
|
||||
QrCodeInvalid("m.qr_code.invalid", "User mismatch")
|
||||
UserError("m.user_error", "User error"),
|
||||
MismatchedUser("m.user_mismatch", "User mismatch"),
|
||||
QrCodeInvalid("m.qr_code.invalid", "Invalid QR code")
|
||||
}
|
||||
|
||||
fun safeValueOf(code: String?): CancelCode {
|
||||
|
|
|
@ -74,7 +74,7 @@ internal class DefaultQrCodeVerificationTransaction(
|
|||
}
|
||||
|
||||
if (otherQrCodeData.userId != otherUserId) {
|
||||
cancel(CancelCode.UserMismatchError)
|
||||
cancel(CancelCode.MismatchedUser)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -156,11 +156,12 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment() {
|
|||
it.qrTransactionState == VerificationTxState.Verified,
|
||||
it.cancelCode?.value))
|
||||
})
|
||||
return@withState
|
||||
}
|
||||
else -> Unit
|
||||
}
|
||||
|
||||
// At this point there is no transaction for this request
|
||||
// At this point there is no SAS transaction for this request
|
||||
|
||||
// Transaction has not yet started
|
||||
if (it.pendingRequest.invoke()?.cancelConclusion != null) {
|
||||
|
|
|
@ -43,6 +43,8 @@ class VerificationConclusionViewModel(initialState: VerificationConclusionViewSt
|
|||
val args = viewModelContext.args<VerificationConclusionFragment.Args>()
|
||||
|
||||
return when (safeValueOf(args.cancelReason)) {
|
||||
CancelCode.QrCodeInvalid,
|
||||
CancelCode.MismatchedUser,
|
||||
CancelCode.MismatchedSas,
|
||||
CancelCode.MismatchedCommitment,
|
||||
CancelCode.MismatchedKeys -> {
|
||||
|
|
Loading…
Reference in New Issue