diff --git a/Cargo.lock b/Cargo.lock index 3b595193..ef032b42 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -42,6 +42,27 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f093eed78becd229346bf859eec0aa4dd7ddde0757287b2b4107a1f09c80002" +[[package]] +name = "async-stream" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a26cb53174ddd320edfff199a853f93d571f48eeb4dde75e67a9a3dbb7b7e5e" +dependencies = [ + "async-stream-impl", + "futures-core", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db134ba52475c060f3329a8ef0f8786d6b872ed01515d4b79c162e5798da1340" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "async-trait" version = "0.1.50" @@ -1640,6 +1661,7 @@ dependencies = [ "js_int", "ruma-api", "ruma-appservice-api", + "ruma-client", "ruma-client-api", "ruma-common", "ruma-events", @@ -1692,6 +1714,26 @@ dependencies = [ "serde_json", ] +[[package]] +name = "ruma-client" +version = "0.5.0-alpha.2" +source = "git+https://github.com/ruma/ruma?rev=bdb38279c34e423a80533f3f7b0c8cada238559f#bdb38279c34e423a80533f3f7b0c8cada238559f" +dependencies = [ + "assign", + "async-stream", + "async-trait", + "bytes", + "futures-core", + "http", + "ruma-api", + "ruma-common", + "ruma-events", + "ruma-identifiers", + "ruma-serde", + "serde", + "serde_json", +] + [[package]] name = "ruma-client-api" version = "0.10.0-alpha.3" diff --git a/Cargo.toml b/Cargo.toml index 9ed78bea..d359b357 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ 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 = "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/ruma/ruma", rev = "bdb38279c34e423a80533f3f7b0c8cada238559f", features = ["client", "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"] } diff --git a/src/appservice_server.rs b/src/appservice_server.rs index 27d0c0d3..4fd0ebfe 100644 --- a/src/appservice_server.rs +++ b/src/appservice_server.rs @@ -1,7 +1,10 @@ use crate::{utils, Error, Result}; use bytes::BytesMut; use log::warn; -use ruma::api::{IncomingResponse, OutgoingRequest, SendAccessToken}; +use ruma::{ + api::{IncomingResponse, OutgoingRequest, SendAccessToken}, + client::HttpClientExt, +}; use std::{ convert::{TryFrom, TryInto}, fmt::Debug,