Merge remote-tracking branch 'upstream/master' into correct-sendtxn

This commit is contained in:
Devin Ragotzy 2021-03-04 08:39:16 -05:00
commit d0df8b495c
49 changed files with 747 additions and 281 deletions

View file

@ -22,6 +22,7 @@ use rocket::{delete, get, post, put};
feature = "conduit_bin",
get("/_matrix/client/r0/pushrules", data = "<body>")
)]
#[tracing::instrument(skip(db, body))]
pub async fn get_pushrules_all_route(
db: State<'_, Database>,
body: Ruma<get_pushrules_all::Request>,
@ -46,6 +47,7 @@ pub async fn get_pushrules_all_route(
feature = "conduit_bin",
get("/_matrix/client/r0/pushrules/<_>/<_>/<_>", data = "<body>")
)]
#[tracing::instrument(skip(db, body))]
pub async fn get_pushrule_route(
db: State<'_, Database>,
body: Ruma<get_pushrule::Request<'_>>,
@ -104,6 +106,7 @@ pub async fn get_pushrule_route(
feature = "conduit_bin",
put("/_matrix/client/r0/pushrules/<_>/<_>/<_>", data = "<body>")
)]
#[tracing::instrument(skip(db, body))]
pub async fn set_pushrule_route(
db: State<'_, Database>,
body: Ruma<set_pushrule::Request<'_>>,
@ -250,6 +253,7 @@ pub async fn set_pushrule_route(
feature = "conduit_bin",
get("/_matrix/client/r0/pushrules/<_>/<_>/<_>/actions", data = "<body>")
)]
#[tracing::instrument(skip(db, body))]
pub async fn get_pushrule_actions_route(
db: State<'_, Database>,
body: Ruma<get_pushrule_actions::Request<'_>>,
@ -313,6 +317,7 @@ pub async fn get_pushrule_actions_route(
feature = "conduit_bin",
put("/_matrix/client/r0/pushrules/<_>/<_>/<_>/actions", data = "<body>")
)]
#[tracing::instrument(skip(db, body))]
pub async fn set_pushrule_actions_route(
db: State<'_, Database>,
body: Ruma<set_pushrule_actions::Request<'_>>,
@ -416,6 +421,7 @@ pub async fn set_pushrule_actions_route(
feature = "conduit_bin",
get("/_matrix/client/r0/pushrules/<_>/<_>/<_>/enabled", data = "<body>")
)]
#[tracing::instrument(skip(db, body))]
pub async fn get_pushrule_enabled_route(
db: State<'_, Database>,
body: Ruma<get_pushrule_enabled::Request<'_>>,
@ -476,6 +482,7 @@ pub async fn get_pushrule_enabled_route(
feature = "conduit_bin",
put("/_matrix/client/r0/pushrules/<_>/<_>/<_>/enabled", data = "<body>")
)]
#[tracing::instrument(skip(db, body))]
pub async fn set_pushrule_enabled_route(
db: State<'_, Database>,
body: Ruma<set_pushrule_enabled::Request<'_>>,
@ -579,6 +586,7 @@ pub async fn set_pushrule_enabled_route(
feature = "conduit_bin",
delete("/_matrix/client/r0/pushrules/<_>/<_>/<_>", data = "<body>")
)]
#[tracing::instrument(skip(db, body))]
pub async fn delete_pushrule_route(
db: State<'_, Database>,
body: Ruma<delete_pushrule::Request<'_>>,
@ -669,6 +677,7 @@ pub async fn delete_pushrule_route(
}
#[cfg_attr(feature = "conduit_bin", get("/_matrix/client/r0/pushers"))]
#[tracing::instrument]
pub async fn get_pushers_route() -> ConduitResult<get_pushers::Response> {
Ok(get_pushers::Response {
pushers: Vec::new(),
@ -677,6 +686,7 @@ pub async fn get_pushers_route() -> ConduitResult<get_pushers::Response> {
}
#[cfg_attr(feature = "conduit_bin", post("/_matrix/client/r0/pushers/set"))]
#[tracing::instrument(skip(db))]
pub async fn set_pushers_route(db: State<'_, Database>) -> ConduitResult<get_pushers::Response> {
db.flush().await?;