diff --git a/src/crypto/olm.rs b/src/crypto/olm.rs index bafd2d56..cc538558 100644 --- a/src/crypto/olm.rs +++ b/src/crypto/olm.rs @@ -172,6 +172,12 @@ impl Session { Ok(plaintext) } + pub fn encrypt(&mut self, plaintext: &str) -> OlmMessage { + let message = self.inner.encrypt(plaintext); + self.last_use_time = Instant::now(); + message + } + pub fn matches( &self, their_identity_key: &str, @@ -317,6 +323,10 @@ impl OutboundGroupSession { self.shared.store(true, Ordering::Relaxed); } + pub fn shared(&self) -> bool { + self.shared.load(Ordering::Relaxed) + } + pub async fn session_key(&self) -> String { let session = self.inner.lock().await; session.session_key()