Bump ruma

This commit is contained in:
Jonas Platte 2021-04-29 11:41:38 +02:00
parent 27d25914e1
commit caa186ad22
No known key found for this signature in database
GPG key ID: CC154DE0E30B7C67
3 changed files with 43 additions and 29 deletions

37
Cargo.lock generated
View file

@ -1634,7 +1634,7 @@ dependencies = [
[[package]]
name = "ruma"
version = "0.0.3"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"assign",
"js_int",
@ -1654,7 +1654,7 @@ dependencies = [
[[package]]
name = "ruma-api"
version = "0.17.0-alpha.4"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"bytes",
"http",
@ -1670,7 +1670,7 @@ dependencies = [
[[package]]
name = "ruma-api-macros"
version = "0.17.0-alpha.4"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@ -1681,7 +1681,7 @@ dependencies = [
[[package]]
name = "ruma-appservice-api"
version = "0.2.0-alpha.3"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"ruma-api",
"ruma-common",
@ -1695,7 +1695,7 @@ dependencies = [
[[package]]
name = "ruma-client-api"
version = "0.10.0-alpha.3"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"assign",
"bytes",
@ -1715,7 +1715,7 @@ dependencies = [
[[package]]
name = "ruma-common"
version = "0.5.0"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"indexmap",
"js_int",
@ -1731,7 +1731,7 @@ dependencies = [
[[package]]
name = "ruma-events"
version = "0.22.0-alpha.3"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"js_int",
"ruma-common",
@ -1745,7 +1745,7 @@ dependencies = [
[[package]]
name = "ruma-events-macros"
version = "0.22.0-alpha.3"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@ -1756,7 +1756,7 @@ dependencies = [
[[package]]
name = "ruma-federation-api"
version = "0.1.0-alpha.2"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"js_int",
"ruma-api",
@ -1771,7 +1771,7 @@ dependencies = [
[[package]]
name = "ruma-identifiers"
version = "0.19.0"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"paste",
"rand",
@ -1785,7 +1785,7 @@ dependencies = [
[[package]]
name = "ruma-identifiers-macros"
version = "0.19.0"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"proc-macro2",
"quote",
@ -1796,13 +1796,14 @@ dependencies = [
[[package]]
name = "ruma-identifiers-validation"
version = "0.3.0"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
[[package]]
name = "ruma-identity-service-api"
version = "0.1.0-alpha.1"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"js_int",
"ruma-api",
"ruma-common",
"ruma-identifiers",
@ -1814,7 +1815,7 @@ dependencies = [
[[package]]
name = "ruma-push-gateway-api"
version = "0.1.0-alpha.1"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"js_int",
"ruma-api",
@ -1829,7 +1830,7 @@ dependencies = [
[[package]]
name = "ruma-serde"
version = "0.3.1"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"bytes",
"form_urlencoded",
@ -1843,7 +1844,7 @@ dependencies = [
[[package]]
name = "ruma-serde-macros"
version = "0.3.1"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"proc-macro-crate",
"proc-macro2",
@ -1854,7 +1855,7 @@ dependencies = [
[[package]]
name = "ruma-signatures"
version = "0.7.0"
source = "git+https://github.com/ruma/ruma?rev=d27584ae3bdc035529e7389f1c392d4c96f9f8eb#d27584ae3bdc035529e7389f1c392d4c96f9f8eb"
source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f"
dependencies = [
"base64 0.13.0",
"ring",
@ -2167,7 +2168,7 @@ dependencies = [
[[package]]
name = "state-res"
version = "0.1.0"
source = "git+https://github.com/ruma/state-res?rev=ce665d213fffeaa47e146d01c6b87f9eb9feaa52#ce665d213fffeaa47e146d01c6b87f9eb9feaa52"
source = "git+https://github.com/ruma/state-res?rev=a4d2182d2fb23f5357a6e52179e951acb0dc43cb#a4d2182d2fb23f5357a6e52179e951acb0dc43cb"
dependencies = [
"itertools 0.10.0",
"log",

View file

@ -18,12 +18,12 @@ rocket = { git = "https://github.com/SergioBenitez/Rocket.git", rev = "801e04bd5
#rocket = { git = "https://github.com/timokoesters/Rocket.git", branch = "empty_parameters", default-features = false, features = ["tls"] }
# Used for matrix spec type definitions and helpers
ruma = { git = "https://github.com/ruma/ruma", rev = "d27584ae3bdc035529e7389f1c392d4c96f9f8eb", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "unstable-pre-spec", "unstable-exhaustive-types"] }
ruma = { git = "https://github.com/ruma/ruma", rev = "bdb38279c34e423a80533f3f7b0c8cada238559f", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "unstable-pre-spec", "unstable-exhaustive-types"] }
#ruma = { git = "https://github.com/timokoesters/ruma", rev = "220d5b4a76b3b781f7f8297fbe6b14473b04214b", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "unstable-pre-spec", "unstable-exhaustive-types"] }
#ruma = { path = "../ruma/ruma", features = ["compat", "rand", "appservice-api-c", "client-api", "federation-api", "push-gateway-api-c", "unstable-pre-spec", "unstable-exhaustive-types"] }
# Used when doing state resolution
state-res = { git = "https://github.com/ruma/state-res", rev = "ce665d213fffeaa47e146d01c6b87f9eb9feaa52", features = ["unstable-pre-spec"] }
state-res = { git = "https://github.com/ruma/state-res", rev = "a4d2182d2fb23f5357a6e52179e951acb0dc43cb", features = ["unstable-pre-spec"] }
#state-res = { path = "../state-res", features = ["unstable-pre-spec"] }
# Used for long polling and federation sender, should be the same as rocket::tokio

View file

@ -8,9 +8,11 @@ use ruma::{
set_room_account_data,
},
},
events::{custom::CustomEventContent, BasicEvent},
events::{custom::CustomEventContent, AnyBasicEventContent, BasicEvent},
serde::Raw,
};
use serde::Deserialize;
use serde_json::value::RawValue as RawJsonValue;
#[cfg(feature = "conduit_bin")]
use rocket::{get, put};
@ -91,14 +93,17 @@ pub async fn get_global_account_data_route(
) -> ConduitResult<get_global_account_data::Response> {
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
let data = db
let event = db
.account_data
.get::<Raw<ruma::events::AnyBasicEvent>>(None, sender_user, body.event_type.clone().into())?
.get::<Box<RawJsonValue>>(None, sender_user, body.event_type.clone().into())?
.ok_or(Error::BadRequest(ErrorKind::NotFound, "Data not found."))?;
db.flush().await?;
Ok(get_global_account_data::Response { account_data: data }.into())
let account_data = serde_json::from_str::<ExtractEventContent>(event.get())
.expect("event to contain a content field")
.content;
Ok(get_global_account_data::Response { account_data }.into())
}
#[cfg_attr(
@ -115,16 +120,24 @@ pub async fn get_room_account_data_route(
) -> ConduitResult<get_room_account_data::Response> {
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
let data = db
let event = db
.account_data
.get::<Raw<ruma::events::AnyBasicEvent>>(
.get::<Box<RawJsonValue>>(
Some(&body.room_id),
sender_user,
body.event_type.clone().into(),
)?
.ok_or(Error::BadRequest(ErrorKind::NotFound, "Data not found."))?;
db.flush().await?;
Ok(get_room_account_data::Response { account_data: data }.into())
let account_data = serde_json::from_str::<ExtractEventContent>(event.get())
.expect("event to contain a content field")
.content;
Ok(get_room_account_data::Response { account_data }.into())
}
#[derive(Deserialize)]
struct ExtractEventContent {
content: Raw<AnyBasicEventContent>,
}