mirror of
https://gitlab.com/famedly/conduit.git
synced 2024-08-18 13:24:40 +02:00
Revert rename of Ruma<_> parameters
This commit is contained in:
parent
f712455047
commit
0183d003d0
|
@ -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
|
||||
#[cfg_attr(
|
||||
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(
|
||||
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> {
|
||||
let body = req.body;
|
||||
let sender_user = req.sender_user.as_ref().expect("user is authenticated");
|
||||
let sender_user = body.sender_user.as_deref().expect("user is authenticated");
|
||||
let body = body.body;
|
||||
|
||||
let (servers, room_id) = match Box::<RoomId>::try_from(body.room_id_or_alias) {
|
||||
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(
|
||||
&db,
|
||||
req.sender_user.as_deref(),
|
||||
Some(sender_user),
|
||||
&room_id,
|
||||
&servers,
|
||||
body.third_party_signed.as_ref(),
|
||||
|
|
|
@ -105,15 +105,15 @@ pub async fn get_pushrule_route(
|
|||
/// Creates a single specified push rule for this user.
|
||||
#[cfg_attr(
|
||||
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(
|
||||
db: DatabaseGuard,
|
||||
req: Ruma<set_pushrule::Request<'_>>,
|
||||
body: Ruma<set_pushrule::Request<'_>>,
|
||||
) -> ConduitResult<set_pushrule::Response> {
|
||||
let sender_user = req.sender_user.as_ref().expect("user is authenticated");
|
||||
let body = req.body;
|
||||
let sender_user = body.sender_user.as_ref().expect("user is authenticated");
|
||||
let body = body.body;
|
||||
|
||||
if body.scope != "global" {
|
||||
return Err(Error::BadRequest(
|
||||
|
|
|
@ -54,17 +54,16 @@ use rocket::{get, tokio};
|
|||
/// `since` will be cached
|
||||
#[cfg_attr(
|
||||
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(
|
||||
db: DatabaseGuard,
|
||||
req: Ruma<sync_events::Request<'_>>,
|
||||
body: Ruma<sync_events::Request<'_>>,
|
||||
) -> Result<RumaResponse<sync_events::Response>, RumaResponse<UiaaResponse>> {
|
||||
let body = req.body;
|
||||
|
||||
let sender_user = req.sender_user.expect("user is authenticated");
|
||||
let sender_device = req.sender_device.expect("user is authenticated");
|
||||
let sender_user = body.sender_user.expect("user is authenticated");
|
||||
let sender_device = body.sender_device.expect("user is authenticated");
|
||||
let body = body.body;
|
||||
|
||||
let arc_db = Arc::new(db);
|
||||
|
||||
|
|
Loading…
Reference in a new issue