crypto: Expose the olm machine only if the encryption feature is enabled.

master
Damir Jelić 2020-09-11 17:06:45 +02:00
parent ffd2843b0a
commit f603696ff4
1 changed files with 2 additions and 0 deletions

View File

@ -1862,6 +1862,8 @@ impl BaseClient {
}
/// Get the olm machine.
#[cfg(feature = "encryption")]
#[cfg_attr(feature = "docs", doc(cfg(encryption)))]
pub async fn olm_machine(&self) -> Option<OlmMachine> {
let olm = self.olm.lock().await;
olm.as_ref().cloned()