Merge pull request #6395 from vector-im/feature/bca/fix_invalid_qr_warning
Display specific message when verif code malformed
This commit is contained in:
commit
fb05ab34d8
1
changelog.d/6395.bugfix
Normal file
1
changelog.d/6395.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Display specific message when verification QR code is malformed
|
@ -84,7 +84,7 @@ internal class DefaultQrCodeVerificationTransaction(
|
|||||||
// Perform some checks
|
// Perform some checks
|
||||||
if (otherQrCodeData.transactionId != transactionId) {
|
if (otherQrCodeData.transactionId != transactionId) {
|
||||||
Timber.d("## Verification QR: Invalid transaction actual ${otherQrCodeData.transactionId} expected:$transactionId")
|
Timber.d("## Verification QR: Invalid transaction actual ${otherQrCodeData.transactionId} expected:$transactionId")
|
||||||
cancel(CancelCode.QrCodeInvalid)
|
cancel(CancelCode.UnknownTransaction)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,6 +86,14 @@ class VerificationConclusionController @Inject constructor(
|
|||||||
|
|
||||||
bottomGotIt()
|
bottomGotIt()
|
||||||
}
|
}
|
||||||
|
ConclusionState.INVALID_QR_CODE -> {
|
||||||
|
bottomSheetVerificationNoticeItem {
|
||||||
|
id("invalid_qr")
|
||||||
|
notice(host.stringProvider.getString(R.string.verify_invalid_qr_notice).toEpoxyCharSequence())
|
||||||
|
}
|
||||||
|
|
||||||
|
bottomGotIt()
|
||||||
|
}
|
||||||
ConclusionState.CANCELLED -> {
|
ConclusionState.CANCELLED -> {
|
||||||
bottomSheetVerificationNoticeItem {
|
bottomSheetVerificationNoticeItem {
|
||||||
id("notice_cancelled")
|
id("notice_cancelled")
|
||||||
|
@ -32,7 +32,8 @@ data class VerificationConclusionViewState(
|
|||||||
enum class ConclusionState {
|
enum class ConclusionState {
|
||||||
SUCCESS,
|
SUCCESS,
|
||||||
WARNING,
|
WARNING,
|
||||||
CANCELLED
|
CANCELLED,
|
||||||
|
INVALID_QR_CODE
|
||||||
}
|
}
|
||||||
|
|
||||||
class VerificationConclusionViewModel(initialState: VerificationConclusionViewState) :
|
class VerificationConclusionViewModel(initialState: VerificationConclusionViewState) :
|
||||||
@ -44,7 +45,9 @@ class VerificationConclusionViewModel(initialState: VerificationConclusionViewSt
|
|||||||
val args = viewModelContext.args<VerificationConclusionFragment.Args>()
|
val args = viewModelContext.args<VerificationConclusionFragment.Args>()
|
||||||
|
|
||||||
return when (safeValueOf(args.cancelReason)) {
|
return when (safeValueOf(args.cancelReason)) {
|
||||||
CancelCode.QrCodeInvalid,
|
CancelCode.QrCodeInvalid -> {
|
||||||
|
VerificationConclusionViewState(ConclusionState.INVALID_QR_CODE, args.isMe)
|
||||||
|
}
|
||||||
CancelCode.MismatchedUser,
|
CancelCode.MismatchedUser,
|
||||||
CancelCode.MismatchedSas,
|
CancelCode.MismatchedSas,
|
||||||
CancelCode.MismatchedCommitment,
|
CancelCode.MismatchedCommitment,
|
||||||
|
@ -2436,6 +2436,7 @@
|
|||||||
</string>
|
</string>
|
||||||
|
|
||||||
<string name="verify_cancelled_notice">Verification has been cancelled. You can start verification again.</string>
|
<string name="verify_cancelled_notice">Verification has been cancelled. You can start verification again.</string>
|
||||||
|
<string name="verify_invalid_qr_notice">This QR code looks malformed. Please try to verify with another method.</string>
|
||||||
<string name="verification_cancelled">Verification Cancelled</string>
|
<string name="verification_cancelled">Verification Cancelled</string>
|
||||||
|
|
||||||
<string name="recovery_passphrase">Recovery Passphrase</string>
|
<string name="recovery_passphrase">Recovery Passphrase</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user