matrix-sdk: Rename the types subproject to matrix-sdk-common.
parent
e9d6e28e13
commit
6cbdbdcd2f
|
@ -2,5 +2,5 @@
|
|||
members = [
|
||||
"matrix_sdk",
|
||||
"matrix_sdk_crypto",
|
||||
"matrix_sdk_types",
|
||||
"matrix_sdk_common",
|
||||
]
|
||||
|
|
|
@ -26,7 +26,7 @@ serde = "1.0.106"
|
|||
serde_json = "1.0.52"
|
||||
uuid = { version = "0.8.1", features = ["v4"] }
|
||||
|
||||
matrix-sdk-types = { path = "../matrix_sdk_types" }
|
||||
matrix-sdk-common = { path = "../matrix_sdk_common" }
|
||||
matrix-sdk-crypto = { path = "../matrix_sdk_crypto", optional = true }
|
||||
|
||||
# Misc dependencies
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#![deny(missing_docs)]
|
||||
|
||||
pub use crate::{error::Error, error::Result, session::Session};
|
||||
pub use matrix_sdk_types::*;
|
||||
pub use matrix_sdk_common::*;
|
||||
pub use reqwest::header::InvalidHeaderValue;
|
||||
|
||||
mod async_client;
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
[package]
|
||||
authors = ["Damir Jelić <poljar@termina.org.uk"]
|
||||
description = "Collection of Matrix types used in the matrix-sdk"
|
||||
description = "Collection of common types used in the matrix-sdk"
|
||||
edition = "2018"
|
||||
homepage = "https://github.com/matrix-org/matrix-rust-sdk"
|
||||
keywords = ["matrix", "chat", "messaging", "ruma", "nio"]
|
||||
license = "Apache-2.0"
|
||||
name = "matrix-sdk-types"
|
||||
name = "matrix-sdk-common"
|
||||
readme = "README.md"
|
||||
repository = "https://github.com/matrix-org/matrix-rust-sdk"
|
||||
version = "0.1.0"
|
|
@ -18,7 +18,7 @@ sqlite-cryptostore = ["sqlx"]
|
|||
futures = "0.3.4"
|
||||
async-trait = "0.1.30"
|
||||
|
||||
matrix-sdk-types = { path = "../matrix_sdk_types" }
|
||||
matrix-sdk-common = { path = "../matrix_sdk_common" }
|
||||
|
||||
olm-rs = { version = "0.5.0", features = ["serde"] }
|
||||
serde = { version = "1.0.106", features = ["derive"] }
|
||||
|
|
|
@ -23,9 +23,9 @@ use atomic::Atomic;
|
|||
|
||||
#[cfg(test)]
|
||||
use super::OlmMachine;
|
||||
use matrix_sdk_types::api::r0::keys::{DeviceKeys, KeyAlgorithm};
|
||||
use matrix_sdk_types::events::Algorithm;
|
||||
use matrix_sdk_types::identifiers::{DeviceId, UserId};
|
||||
use matrix_sdk_common::api::r0::keys::{DeviceKeys, KeyAlgorithm};
|
||||
use matrix_sdk_common::events::Algorithm;
|
||||
use matrix_sdk_common::identifiers::{DeviceId, UserId};
|
||||
|
||||
/// A device represents a E2EE capable client of an user.
|
||||
#[derive(Debug, Clone)]
|
||||
|
@ -224,8 +224,8 @@ pub(crate) mod test {
|
|||
use std::convert::{From, TryFrom};
|
||||
|
||||
use crate::device::{Device, TrustState};
|
||||
use matrix_sdk_types::api::r0::keys::{DeviceKeys, KeyAlgorithm};
|
||||
use matrix_sdk_types::identifiers::UserId;
|
||||
use matrix_sdk_common::api::r0::keys::{DeviceKeys, KeyAlgorithm};
|
||||
use matrix_sdk_common::identifiers::UserId;
|
||||
|
||||
fn device_keys() -> DeviceKeys {
|
||||
let user_id = UserId::try_from("@alice:example.org").unwrap();
|
||||
|
|
|
@ -31,8 +31,8 @@ use super::store::memorystore::MemoryStore;
|
|||
use super::store::sqlite::SqliteStore;
|
||||
use super::{device::Device, store::Result as StoreError, CryptoStore};
|
||||
|
||||
use matrix_sdk_types::api;
|
||||
use matrix_sdk_types::events::{
|
||||
use matrix_sdk_common::api;
|
||||
use matrix_sdk_common::events::{
|
||||
collections::all::RoomEvent,
|
||||
room::encrypted::{
|
||||
CiphertextInfo, EncryptedEvent, EncryptedEventContent, MegolmV1AesSha2Content,
|
||||
|
@ -45,7 +45,7 @@ use matrix_sdk_types::events::{
|
|||
},
|
||||
Algorithm, EventJson, EventType,
|
||||
};
|
||||
use matrix_sdk_types::identifiers::{DeviceId, RoomId, UserId};
|
||||
use matrix_sdk_common::identifiers::{DeviceId, RoomId, UserId};
|
||||
|
||||
use api::r0::keys;
|
||||
use api::r0::{
|
||||
|
@ -1550,7 +1550,7 @@ mod test {
|
|||
static USER_ID: &str = "@bob:example.org";
|
||||
static DEVICE_ID: &str = "DEVICEID";
|
||||
|
||||
use matrix_sdk_types::js_int::UInt;
|
||||
use matrix_sdk_common::js_int::UInt;
|
||||
use std::collections::BTreeMap;
|
||||
use std::convert::TryFrom;
|
||||
use std::fs::File;
|
||||
|
@ -1564,10 +1564,10 @@ mod test {
|
|||
use crate::machine::{OlmMachine, OneTimeKeys};
|
||||
use crate::Device;
|
||||
|
||||
use matrix_sdk_types::api::r0::{
|
||||
use matrix_sdk_common::api::r0::{
|
||||
keys, to_device::send_event_to_device::Request as ToDeviceRequest,
|
||||
};
|
||||
use matrix_sdk_types::events::{
|
||||
use matrix_sdk_common::events::{
|
||||
collections::all::RoomEvent,
|
||||
room::{
|
||||
encrypted::{EncryptedEvent, EncryptedEventContent},
|
||||
|
@ -1576,7 +1576,7 @@ mod test {
|
|||
to_device::{AnyToDeviceEvent, ToDeviceEncrypted},
|
||||
EventJson, EventType, UnsignedData,
|
||||
};
|
||||
use matrix_sdk_types::identifiers::{DeviceId, EventId, RoomId, UserId};
|
||||
use matrix_sdk_common::identifiers::{DeviceId, EventId, RoomId, UserId};
|
||||
|
||||
fn alice_id() -> UserId {
|
||||
UserId::try_from("@alice:example.org").unwrap()
|
||||
|
|
|
@ -20,7 +20,7 @@ use tokio::sync::Mutex;
|
|||
|
||||
use super::device::Device;
|
||||
use super::olm::{InboundGroupSession, Session};
|
||||
use matrix_sdk_types::identifiers::{DeviceId, RoomId, UserId};
|
||||
use matrix_sdk_common::identifiers::{DeviceId, RoomId, UserId};
|
||||
|
||||
/// In-memory store for Olm Sessions.
|
||||
#[derive(Debug, Default)]
|
||||
|
@ -215,7 +215,7 @@ mod test {
|
|||
use crate::memory_stores::{DeviceStore, GroupSessionStore, SessionStore};
|
||||
use crate::olm::test::get_account_and_session;
|
||||
use crate::olm::{InboundGroupSession, OutboundGroupSession};
|
||||
use matrix_sdk_types::identifiers::RoomId;
|
||||
use matrix_sdk_common::identifiers::RoomId;
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_session_store() {
|
||||
|
|
|
@ -35,8 +35,8 @@ pub use olm_rs::{
|
|||
utility::OlmUtility,
|
||||
};
|
||||
|
||||
use matrix_sdk_types::api::r0::keys::SignedKey;
|
||||
use matrix_sdk_types::identifiers::RoomId;
|
||||
use matrix_sdk_common::api::r0::keys::SignedKey;
|
||||
use matrix_sdk_common::identifiers::RoomId;
|
||||
|
||||
/// Account holding identity keys for which sessions can be created.
|
||||
///
|
||||
|
@ -627,8 +627,8 @@ impl std::fmt::Debug for OutboundGroupSession {
|
|||
#[cfg(test)]
|
||||
pub(crate) mod test {
|
||||
use crate::olm::{Account, InboundGroupSession, OutboundGroupSession, Session};
|
||||
use matrix_sdk_types::api::r0::keys::SignedKey;
|
||||
use matrix_sdk_types::identifiers::RoomId;
|
||||
use matrix_sdk_common::api::r0::keys::SignedKey;
|
||||
use matrix_sdk_common::identifiers::RoomId;
|
||||
use olm_rs::session::OlmMessage;
|
||||
use std::collections::BTreeMap;
|
||||
use std::convert::TryFrom;
|
||||
|
|
|
@ -21,7 +21,7 @@ use tokio::sync::Mutex;
|
|||
use super::{Account, CryptoStore, InboundGroupSession, Result, Session};
|
||||
use crate::device::Device;
|
||||
use crate::memory_stores::{DeviceStore, GroupSessionStore, SessionStore, UserDevices};
|
||||
use matrix_sdk_types::identifiers::{DeviceId, RoomId, UserId};
|
||||
use matrix_sdk_common::identifiers::{DeviceId, RoomId, UserId};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct MemoryStore {
|
||||
|
@ -119,7 +119,7 @@ mod test {
|
|||
use crate::olm::{InboundGroupSession, OutboundGroupSession};
|
||||
use crate::store::memorystore::MemoryStore;
|
||||
use crate::store::CryptoStore;
|
||||
use matrix_sdk_types::identifiers::RoomId;
|
||||
use matrix_sdk_common::identifiers::RoomId;
|
||||
|
||||
#[tokio::test]
|
||||
async fn test_session_store() {
|
||||
|
|
|
@ -26,7 +26,7 @@ use tokio::sync::Mutex;
|
|||
use super::device::Device;
|
||||
use super::memory_stores::UserDevices;
|
||||
use super::olm::{Account, InboundGroupSession, Session};
|
||||
use matrix_sdk_types::identifiers::{DeviceId, RoomId, UserId};
|
||||
use matrix_sdk_common::identifiers::{DeviceId, RoomId, UserId};
|
||||
use olm_rs::errors::{OlmAccountError, OlmGroupSessionError, OlmSessionError};
|
||||
|
||||
pub mod memorystore;
|
||||
|
|
|
@ -30,9 +30,9 @@ use zeroize::Zeroizing;
|
|||
use super::{Account, CryptoStore, CryptoStoreError, InboundGroupSession, Result, Session};
|
||||
use crate::device::{Device, TrustState};
|
||||
use crate::memory_stores::{DeviceStore, GroupSessionStore, SessionStore, UserDevices};
|
||||
use matrix_sdk_types::api::r0::keys::KeyAlgorithm;
|
||||
use matrix_sdk_types::events::Algorithm;
|
||||
use matrix_sdk_types::identifiers::{DeviceId, RoomId, UserId};
|
||||
use matrix_sdk_common::api::r0::keys::KeyAlgorithm;
|
||||
use matrix_sdk_common::events::Algorithm;
|
||||
use matrix_sdk_common::identifiers::{DeviceId, RoomId, UserId};
|
||||
|
||||
/// SQLite based implementation of a `CryptoStore`.
|
||||
pub struct SqliteStore {
|
||||
|
@ -694,7 +694,7 @@ impl std::fmt::Debug for SqliteStore {
|
|||
mod test {
|
||||
use crate::device::test::get_device;
|
||||
use crate::olm::GroupSessionKey;
|
||||
use matrix_sdk_types::api::r0::keys::SignedKey;
|
||||
use matrix_sdk_common::api::r0::keys::SignedKey;
|
||||
use olm_rs::outbound_group_session::OlmOutboundGroupSession;
|
||||
use std::collections::BTreeMap;
|
||||
use tempfile::tempdir;
|
||||
|
|
Loading…
Reference in New Issue