From ae37e6ec9d37a59c2f490e13d9bddc55827ab2e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Fri, 9 Jul 2021 11:38:10 +0200 Subject: [PATCH] crypto: Add a state getter where we scanned the QR code --- matrix_sdk_crypto/src/verification/qrcode.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/matrix_sdk_crypto/src/verification/qrcode.rs b/matrix_sdk_crypto/src/verification/qrcode.rs index 9ded7336..455bec20 100644 --- a/matrix_sdk_crypto/src/verification/qrcode.rs +++ b/matrix_sdk_crypto/src/verification/qrcode.rs @@ -165,6 +165,12 @@ impl QrVerification { self.identities.is_self_verification() } + /// Have we successfully scanned the QR code and are able to send a + /// reciprocation event. + pub fn reciprocated(&self) -> bool { + matches!(&*self.state.lock().unwrap(), InnerState::Reciprocated(_)) + } + /// Get the unique ID that identifies this QR code verification flow. pub fn flow_id(&self) -> &FlowId { &self.flow_id