crypto: Add a state getter where we scanned the QR code

master
Damir Jelić 2021-07-09 11:38:10 +02:00
parent c5df7c5356
commit ae37e6ec9d
1 changed files with 6 additions and 0 deletions

View File

@ -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