diff --git a/matrix_sdk_crypto/src/verification/requests.rs b/matrix_sdk_crypto/src/verification/requests.rs index 6ba52aa3..12459b04 100644 --- a/matrix_sdk_crypto/src/verification/requests.rs +++ b/matrix_sdk_crypto/src/verification/requests.rs @@ -70,6 +70,7 @@ pub struct VerificationRequest { flow_id: Arc, other_user_id: Arc, inner: Arc>, + we_started: bool, } impl VerificationRequest { @@ -100,6 +101,7 @@ impl VerificationRequest { flow_id: flow_id.into(), inner, other_user_id: other_user.to_owned().into(), + we_started: true, } } @@ -128,6 +130,7 @@ impl VerificationRequest { flow_id: flow_id.into(), inner, other_user_id: other_user.to_owned().into(), + we_started: true, } } @@ -213,6 +216,11 @@ impl VerificationRequest { self.account.user_id() == self.other_user() } + /// Did we initiate the verification request + pub fn we_started(&self) -> bool { + self.we_started + } + /// Has the verification flow that was started with this request finished. pub fn is_done(&self) -> bool { matches!(&*self.inner.lock().unwrap(), InnerRequest::Done(_)) @@ -284,6 +292,7 @@ impl VerificationRequest { account, other_user_id: sender.to_owned().into(), flow_id: flow_id.into(), + we_started: false, } }