From 877b880ded86ba68a7681c716398a048dd4561b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Tue, 21 Apr 2020 11:03:28 +0200 Subject: [PATCH] crypto: Expose the devices publicly. --- src/crypto/device.rs | 1 + src/crypto/mod.rs | 5 ++--- src/lib.rs | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/crypto/device.rs b/src/crypto/device.rs index d0b2fcf1..87ad25c4 100644 --- a/src/crypto/device.rs +++ b/src/crypto/device.rs @@ -23,6 +23,7 @@ use crate::api::r0::keys::{DeviceKeys, KeyAlgorithm}; use crate::events::Algorithm; use crate::identifiers::{DeviceId, UserId}; +/// A device represents a E2EE capable client of an user. #[derive(Debug, Clone)] pub struct Device { user_id: Arc, diff --git a/src/crypto/mod.rs b/src/crypto/mod.rs index 01df02bc..992ac022 100644 --- a/src/crypto/mod.rs +++ b/src/crypto/mod.rs @@ -12,15 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -mod error; -// TODO remove this. mod device; +mod error; mod machine; mod memory_stores; -#[allow(dead_code)] mod olm; mod store; +pub use device::{Device, TrustState}; pub use error::OlmError; pub use machine::{OlmMachine, OneTimeKeys}; pub use store::{CryptoStore, CryptoStoreError}; diff --git a/src/lib.rs b/src/lib.rs index b3c13bdb..93bfa375 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -49,6 +49,8 @@ mod crypto; pub use async_client::{AsyncClient, AsyncClientConfig, SyncSettings}; pub use base_client::Client; +#[cfg(feature = "encryption")] +pub use crypto::{Device, TrustState}; pub use event_emitter::EventEmitter; pub use models::Room; pub use request_builder::{MessagesRequestBuilder, RoomBuilder};