From eeda7cbe0a4e8fc5d34f3d63d6dc799e2eb9fc3c Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 15 Apr 2022 12:10:16 +0200 Subject: [PATCH] Upgrade Ruma --- Cargo.lock | 22 +++++++++++----------- Cargo.toml | 2 +- src/client_server/membership.rs | 2 +- src/database/pusher.rs | 5 +---- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3a251b66..aa09d91b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2109,7 +2109,7 @@ dependencies = [ [[package]] name = "ruma" version = "0.5.0" -source = "git+https://github.com/ruma/ruma?rev=d614ad1422d6c4b3437ebc318ca8514ae338fd6d#d614ad1422d6c4b3437ebc318ca8514ae338fd6d" +source = "git+https://github.com/ruma/ruma?rev=3ec82181581b6411d2fa96c196bc96052236d3a5#3ec82181581b6411d2fa96c196bc96052236d3a5" dependencies = [ "assign", "js_int", @@ -2126,7 +2126,7 @@ dependencies = [ [[package]] name = "ruma-appservice-api" version = "0.5.0" -source = "git+https://github.com/ruma/ruma?rev=d614ad1422d6c4b3437ebc318ca8514ae338fd6d#d614ad1422d6c4b3437ebc318ca8514ae338fd6d" +source = "git+https://github.com/ruma/ruma?rev=3ec82181581b6411d2fa96c196bc96052236d3a5#3ec82181581b6411d2fa96c196bc96052236d3a5" dependencies = [ "ruma-common", "serde", @@ -2136,7 +2136,7 @@ dependencies = [ [[package]] name = "ruma-client-api" version = "0.13.0" -source = "git+https://github.com/ruma/ruma?rev=d614ad1422d6c4b3437ebc318ca8514ae338fd6d#d614ad1422d6c4b3437ebc318ca8514ae338fd6d" +source = "git+https://github.com/ruma/ruma?rev=3ec82181581b6411d2fa96c196bc96052236d3a5#3ec82181581b6411d2fa96c196bc96052236d3a5" dependencies = [ "assign", "bytes", @@ -2152,7 +2152,7 @@ dependencies = [ [[package]] name = "ruma-common" version = "0.8.0" -source = "git+https://github.com/ruma/ruma?rev=d614ad1422d6c4b3437ebc318ca8514ae338fd6d#d614ad1422d6c4b3437ebc318ca8514ae338fd6d" +source = "git+https://github.com/ruma/ruma?rev=3ec82181581b6411d2fa96c196bc96052236d3a5#3ec82181581b6411d2fa96c196bc96052236d3a5" dependencies = [ "base64 0.13.0", "bytes", @@ -2178,7 +2178,7 @@ dependencies = [ [[package]] name = "ruma-federation-api" version = "0.4.0" -source = "git+https://github.com/ruma/ruma?rev=d614ad1422d6c4b3437ebc318ca8514ae338fd6d#d614ad1422d6c4b3437ebc318ca8514ae338fd6d" +source = "git+https://github.com/ruma/ruma?rev=3ec82181581b6411d2fa96c196bc96052236d3a5#3ec82181581b6411d2fa96c196bc96052236d3a5" dependencies = [ "js_int", "ruma-common", @@ -2189,7 +2189,7 @@ dependencies = [ [[package]] name = "ruma-identifiers-validation" version = "0.7.0" -source = "git+https://github.com/ruma/ruma?rev=d614ad1422d6c4b3437ebc318ca8514ae338fd6d#d614ad1422d6c4b3437ebc318ca8514ae338fd6d" +source = "git+https://github.com/ruma/ruma?rev=3ec82181581b6411d2fa96c196bc96052236d3a5#3ec82181581b6411d2fa96c196bc96052236d3a5" dependencies = [ "thiserror", "url", @@ -2198,7 +2198,7 @@ dependencies = [ [[package]] name = "ruma-identity-service-api" version = "0.4.0" -source = "git+https://github.com/ruma/ruma?rev=d614ad1422d6c4b3437ebc318ca8514ae338fd6d#d614ad1422d6c4b3437ebc318ca8514ae338fd6d" +source = "git+https://github.com/ruma/ruma?rev=3ec82181581b6411d2fa96c196bc96052236d3a5#3ec82181581b6411d2fa96c196bc96052236d3a5" dependencies = [ "js_int", "ruma-common", @@ -2208,7 +2208,7 @@ dependencies = [ [[package]] name = "ruma-macros" version = "0.1.0" -source = "git+https://github.com/ruma/ruma?rev=d614ad1422d6c4b3437ebc318ca8514ae338fd6d#d614ad1422d6c4b3437ebc318ca8514ae338fd6d" +source = "git+https://github.com/ruma/ruma?rev=3ec82181581b6411d2fa96c196bc96052236d3a5#3ec82181581b6411d2fa96c196bc96052236d3a5" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2220,7 +2220,7 @@ dependencies = [ [[package]] name = "ruma-push-gateway-api" version = "0.4.0" -source = "git+https://github.com/ruma/ruma?rev=d614ad1422d6c4b3437ebc318ca8514ae338fd6d#d614ad1422d6c4b3437ebc318ca8514ae338fd6d" +source = "git+https://github.com/ruma/ruma?rev=3ec82181581b6411d2fa96c196bc96052236d3a5#3ec82181581b6411d2fa96c196bc96052236d3a5" dependencies = [ "js_int", "ruma-common", @@ -2231,7 +2231,7 @@ dependencies = [ [[package]] name = "ruma-signatures" version = "0.10.0" -source = "git+https://github.com/ruma/ruma?rev=d614ad1422d6c4b3437ebc318ca8514ae338fd6d#d614ad1422d6c4b3437ebc318ca8514ae338fd6d" +source = "git+https://github.com/ruma/ruma?rev=3ec82181581b6411d2fa96c196bc96052236d3a5#3ec82181581b6411d2fa96c196bc96052236d3a5" dependencies = [ "base64 0.13.0", "ed25519-dalek", @@ -2247,7 +2247,7 @@ dependencies = [ [[package]] name = "ruma-state-res" version = "0.6.0" -source = "git+https://github.com/ruma/ruma?rev=d614ad1422d6c4b3437ebc318ca8514ae338fd6d#d614ad1422d6c4b3437ebc318ca8514ae338fd6d" +source = "git+https://github.com/ruma/ruma?rev=3ec82181581b6411d2fa96c196bc96052236d3a5#3ec82181581b6411d2fa96c196bc96052236d3a5" dependencies = [ "itertools", "js_int", diff --git a/Cargo.toml b/Cargo.toml index 64b7a233..11eee91c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ tower-http = { version = "0.2.1", features = ["add-extension", "cors", "compress # Used for matrix spec type definitions and helpers #ruma = { version = "0.4.0", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-pre-spec", "unstable-exhaustive-types"] } -ruma = { git = "https://github.com/ruma/ruma", rev = "d614ad1422d6c4b3437ebc318ca8514ae338fd6d", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-msc2448", "unstable-pre-spec", "unstable-exhaustive-types"] } +ruma = { git = "https://github.com/ruma/ruma", rev = "3ec82181581b6411d2fa96c196bc96052236d3a5", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-msc2448", "unstable-pre-spec", "unstable-exhaustive-types"] } #ruma = { git = "https://github.com/timokoesters/ruma", rev = "50c1db7e0a3a21fc794b0cce3b64285a4c750c71", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-pre-spec", "unstable-exhaustive-types"] } #ruma = { path = "../ruma/crates/ruma", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "state-res", "unstable-pre-spec", "unstable-exhaustive-types"] } diff --git a/src/client_server/membership.rs b/src/client_server/membership.rs index 65107a3c..5e117626 100644 --- a/src/client_server/membership.rs +++ b/src/client_server/membership.rs @@ -416,7 +416,7 @@ pub async fn get_member_events_route( .room_state_full(&body.room_id)? .iter() .filter(|(key, _)| key.0 == StateEventType::RoomMember) - .map(|(_, pdu)| pdu.to_member_event().into()) + .map(|(_, pdu)| pdu.to_member_event().cast()) .collect(), }) } diff --git a/src/database/pusher.rs b/src/database/pusher.rs index 6b906c24..fd55fe3d 100644 --- a/src/database/pusher.rs +++ b/src/database/pusher.rs @@ -274,10 +274,7 @@ async fn send_notice( }; let mut device = Device::new(pusher.app_id.clone(), pusher.pushkey.clone()); - let mut data_minus_url = pusher.data.clone(); - // The url must be stripped off according to spec - data_minus_url.url = None; - device.data = data_minus_url; + device.data = pusher.data.clone().into(); // Tweaks are only added if the format is NOT event_id_only if !event_id_only {