crypto: Add a couple more getters for the SAS verification
parent
c78406ceb9
commit
9a685d685c
|
@ -312,6 +312,18 @@ impl InnerSas {
|
||||||
matches!(self, InnerSas::Cancelled(_))
|
matches!(self, InnerSas::Cancelled(_))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn have_we_confirmed(&self) -> bool {
|
||||||
|
matches!(self, InnerSas::Confirmed(_) | InnerSas::WaitingForDone(_) | InnerSas::Done(_))
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn cancel_code(&self) -> Option<CancelCode> {
|
||||||
|
if let InnerSas::Cancelled(c) = self {
|
||||||
|
Some(c.state.cancel_code.clone())
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn timed_out(&self) -> bool {
|
pub fn timed_out(&self) -> bool {
|
||||||
match self {
|
match self {
|
||||||
InnerSas::Created(s) => s.timed_out(),
|
InnerSas::Created(s) => s.timed_out(),
|
||||||
|
|
|
@ -104,6 +104,16 @@ impl Sas {
|
||||||
self.identities_being_verified.is_self_verification()
|
self.identities_being_verified.is_self_verification()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Have we confirmed that the short auth string matches.
|
||||||
|
pub fn have_we_confirmed(&self) -> bool {
|
||||||
|
self.inner.lock().unwrap().have_we_confirmed()
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get the cancel code of this SAS verification if it has been cancelled
|
||||||
|
pub fn cancel_code(&self) -> Option<CancelCode> {
|
||||||
|
self.inner.lock().unwrap().cancel_code()
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub(crate) fn set_creation_time(&self, time: Instant) {
|
pub(crate) fn set_creation_time(&self, time: Instant) {
|
||||||
|
|
Loading…
Reference in New Issue