matrix-sdk: Update our deps and re-implement PartialEq for the ClientState.

This commit is contained in:
Damir Jelić 2020-05-04 14:06:34 +02:00
parent addb455d16
commit 60cc939fdd
3 changed files with 21 additions and 15 deletions

View file

@ -23,39 +23,39 @@ http = "0.2.1"
url = "2.1.1"
async-trait = "0.1.30"
serde = "1.0.106"
serde_json = "1.0.51"
serde_json = "1.0.52"
uuid = { version = "0.8.1", features = ["v4"] }
matrix-sdk-types = { path = "../matrix_sdk_types" }
matrix-sdk-crypto = { path = "../matrix_sdk_crypto", optional = true }
# Misc dependencies
thiserror = "1.0.14"
thiserror = "1.0.16"
tracing = "0.1.13"
atomic = "0.4.5"
dashmap = "3.10.0"
dashmap = "3.11.1"
[dependencies.tracing-futures]
version = "0.2.3"
version = "0.2.4"
default-features = false
features = ["std", "std-future"]
[dependencies.tokio]
version = "0.2.16"
version = "0.2.20"
default-features = false
features = ["sync", "time", "fs"]
[dependencies.sqlx]
version = "0.3.3"
version = "0.3.4"
optional = true
default-features = false
features = ["runtime-tokio", "sqlite"]
[dev-dependencies]
tokio = { version = "0.2.16", features = ["rt-threaded", "macros"] }
ruma-identifiers = { version = "0.16.0", features = ["rand"] }
serde_json = "1.0.51"
tracing-subscriber = "0.2.4"
tokio = { version = "0.2.20", features = ["rt-threaded", "macros"] }
ruma-identifiers = { version = "0.16.1", features = ["rand"] }
serde_json = "1.0.52"
tracing-subscriber = "0.2.5"
tempfile = "3.1.0"
mockito = "0.25.1"
lazy_static = "1.4.0"

View file

@ -31,7 +31,7 @@ use crate::{Result, Room, Session};
/// When implementing `StateStore` for something other than the filesystem
/// implement `From<ClientState> for YourDbType` this allows for easy conversion
/// when needed in `StateStore::load/store_client_state`
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct ClientState {
/// The current sync token that should be used for the next sync call.
pub sync_token: Option<Token>,
@ -41,6 +41,12 @@ pub struct ClientState {
pub push_ruleset: Option<Ruleset>,
}
impl PartialEq for ClientState {
fn eq(&self, other: &Self) -> bool {
self.sync_token == other.sync_token && self.ignored_users == other.ignored_users
}
}
impl ClientState {
pub fn from_base_client(client: &BaseClient) -> ClientState {
let BaseClient {

View file

@ -12,7 +12,7 @@ version = "0.1.0"
[dependencies]
js_int = "0.1.5"
ruma-api = "0.16.0-rc.2"
ruma-client-api = { version = "0.8.0-rc.5" }
ruma-events = { version = "0.21.0-beta.1" }
ruma-identifiers = "0.16.0"
ruma-api = "0.16.0-rc.3"
ruma-client-api = "0.8.0-rc.5"
ruma-events = "0.21.0"
ruma-identifiers = "0.16.1"