1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2024-11-04 17:29:14 +01:00

Revert rename of Ruma<_> parameters

This commit is contained in:
Jonas Platte 2021-12-15 13:58:25 +01:00
parent f712455047
commit 0183d003d0
No known key found for this signature in database
GPG key ID: CC154DE0E30B7C67
3 changed files with 17 additions and 18 deletions

View file

@ -93,15 +93,15 @@ pub async fn join_room_by_id_route(
/// - If the server does not know about the room: asks other servers over federation /// - If the server does not know about the room: asks other servers over federation
#[cfg_attr( #[cfg_attr(
feature = "conduit_bin", feature = "conduit_bin",
post("/_matrix/client/r0/join/<_>", data = "<req>") post("/_matrix/client/r0/join/<_>", data = "<body>")
)] )]
#[tracing::instrument(skip(db, req))] #[tracing::instrument(skip(db, body))]
pub async fn join_room_by_id_or_alias_route( pub async fn join_room_by_id_or_alias_route(
db: DatabaseGuard, db: DatabaseGuard,
req: Ruma<join_room_by_id_or_alias::Request<'_>>, body: Ruma<join_room_by_id_or_alias::Request<'_>>,
) -> ConduitResult<join_room_by_id_or_alias::Response> { ) -> ConduitResult<join_room_by_id_or_alias::Response> {
let body = req.body; let sender_user = body.sender_user.as_deref().expect("user is authenticated");
let sender_user = req.sender_user.as_ref().expect("user is authenticated"); let body = body.body;
let (servers, room_id) = match Box::<RoomId>::try_from(body.room_id_or_alias) { let (servers, room_id) = match Box::<RoomId>::try_from(body.room_id_or_alias) {
Ok(room_id) => { Ok(room_id) => {
@ -129,7 +129,7 @@ pub async fn join_room_by_id_or_alias_route(
let join_room_response = join_room_by_id_helper( let join_room_response = join_room_by_id_helper(
&db, &db,
req.sender_user.as_deref(), Some(sender_user),
&room_id, &room_id,
&servers, &servers,
body.third_party_signed.as_ref(), body.third_party_signed.as_ref(),

View file

@ -105,15 +105,15 @@ pub async fn get_pushrule_route(
/// Creates a single specified push rule for this user. /// Creates a single specified push rule for this user.
#[cfg_attr( #[cfg_attr(
feature = "conduit_bin", feature = "conduit_bin",
put("/_matrix/client/r0/pushrules/<_>/<_>/<_>", data = "<req>") put("/_matrix/client/r0/pushrules/<_>/<_>/<_>", data = "<body>")
)] )]
#[tracing::instrument(skip(db, req))] #[tracing::instrument(skip(db, body))]
pub async fn set_pushrule_route( pub async fn set_pushrule_route(
db: DatabaseGuard, db: DatabaseGuard,
req: Ruma<set_pushrule::Request<'_>>, body: Ruma<set_pushrule::Request<'_>>,
) -> ConduitResult<set_pushrule::Response> { ) -> ConduitResult<set_pushrule::Response> {
let sender_user = req.sender_user.as_ref().expect("user is authenticated"); let sender_user = body.sender_user.as_ref().expect("user is authenticated");
let body = req.body; let body = body.body;
if body.scope != "global" { if body.scope != "global" {
return Err(Error::BadRequest( return Err(Error::BadRequest(

View file

@ -54,17 +54,16 @@ use rocket::{get, tokio};
/// `since` will be cached /// `since` will be cached
#[cfg_attr( #[cfg_attr(
feature = "conduit_bin", feature = "conduit_bin",
get("/_matrix/client/r0/sync", data = "<req>") get("/_matrix/client/r0/sync", data = "<body>")
)] )]
#[tracing::instrument(skip(db, req))] #[tracing::instrument(skip(db, body))]
pub async fn sync_events_route( pub async fn sync_events_route(
db: DatabaseGuard, db: DatabaseGuard,
req: Ruma<sync_events::Request<'_>>, body: Ruma<sync_events::Request<'_>>,
) -> Result<RumaResponse<sync_events::Response>, RumaResponse<UiaaResponse>> { ) -> Result<RumaResponse<sync_events::Response>, RumaResponse<UiaaResponse>> {
let body = req.body; let sender_user = body.sender_user.expect("user is authenticated");
let sender_device = body.sender_device.expect("user is authenticated");
let sender_user = req.sender_user.expect("user is authenticated"); let body = body.body;
let sender_device = req.sender_device.expect("user is authenticated");
let arc_db = Arc::new(db); let arc_db = Arc::new(db);