| 1 | // Copyright 2020 Damir Jelić |
| 2 | // Copyright 2020 The Matrix.org Foundation C.I.C. |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | |
| 16 | #![doc = include_str!("../README.md")] |
| 17 | #![cfg_attr(docsrs, feature(doc_cfg))] |
| 18 | #![cfg_attr(target_family = "wasm", allow(clippy::arc_with_non_send_sync))] |
| 19 | #![warn(missing_docs, missing_debug_implementations)] |
| 20 | |
| 21 | pub use matrix_sdk_common::*; |
| 22 | use ruma::{OwnedDeviceId, OwnedUserId}; |
| 23 | use serde::{Deserialize, Serialize}; |
| 24 | |
| 25 | pub use crate::error::{Error, Result}; |
| 26 | |
| 27 | mod client; |
| 28 | pub use client::RequestedRequiredStates; |
| 29 | pub mod debug; |
| 30 | pub mod deserialized_responses; |
| 31 | mod error; |
| 32 | pub mod event_cache; |
| 33 | pub mod latest_event; |
| 34 | pub mod media; |
| 35 | pub mod notification_settings; |
| 36 | pub mod read_receipts; |
| 37 | mod response_processors; |
| 38 | mod room; |
| 39 | |
| 40 | pub mod sliding_sync; |
| 41 | |
| 42 | pub mod store; |
| 43 | pub mod sync; |
| 44 | #[cfg(any(test, feature = "testing"))] |
| 45 | mod test_utils; |
| 46 | mod utils; |
| 47 | |
| 48 | pub use client::DmRoomDefinition; |
| 49 | |
| 50 | #[cfg(feature = "experimental-element-recent-emojis")] |
| 51 | pub mod recent_emojis; |
| 52 | |
| 53 | #[cfg(feature = "uniffi")] |
| 54 | uniffi::setup_scaffolding!(); |
| 55 | |
| 56 | pub use client::{BaseClient, ThreadingSupport}; |
| 57 | #[cfg(any(test, feature = "testing"))] |
| 58 | pub use http; |
| 59 | #[cfg(feature = "e2e-encryption")] |
| 60 | pub use matrix_sdk_crypto as crypto; |
| 61 | pub use room::{ |
| 62 | CallIntentConsensus, EncryptionState, PredecessorRoom, Room, RoomCreateWithCreatorEventContent, |
| 63 | RoomDisplayName, RoomHero, RoomInfo, RoomInfoNotableUpdate, RoomInfoNotableUpdateReasons, |
| 64 | RoomMember, RoomMembersUpdate, RoomMemberships, RoomRecencyStamp, RoomState, RoomStateFilter, |
| 65 | SuccessorRoom, apply_redaction, |
| 66 | }; |
| 67 | pub use store::{ |
| 68 | ComposerDraft, ComposerDraftType, DraftAttachment, DraftAttachmentContent, DraftThumbnail, |
| 69 | QueueWedgeError, StateChanges, StateStore, StateStoreDataKey, StateStoreDataValue, StoreError, |
| 70 | ThreadSubscriptionCatchupToken, |
| 71 | }; |
| 72 | pub use utils::{MinimalRoomMemberEvent, MinimalStateEvent, RawStateEventWithKeys}; |
| 73 | |
| 74 | #[cfg(test)] |
| 75 | matrix_sdk_test_utils::init_tracing_for_tests!(); |
| 76 | |
| 77 | /// The Matrix user session info. |
| 78 | #[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)] |
| 79 | pub struct SessionMeta { |
| 80 | /// The ID of the session's user. |
| 81 | pub user_id: OwnedUserId, |
| 82 | /// The ID of the client device. |
| 83 | pub device_id: OwnedDeviceId, |
| 84 | } |