mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
refactor: Fix errors in api/server/make_leave.rs
This commit is contained in:
@@ -45,8 +45,8 @@ pub(crate) async fn create_leave_event_template_route(
|
|||||||
.acl_check(body.origin(), &body.room_id)
|
.acl_check(body.origin(), &body.room_id)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
let room_version_id = services.rooms.state.get_room_version(&body.room_id).await?;
|
let room_version = services.rooms.state.get_room_version(&body.room_id).await?;
|
||||||
let state_lock = services.rooms.state.mutex.lock(&body.room_id).await;
|
let state_lock = services.rooms.state.mutex.lock(body.room_id.as_str()).await;
|
||||||
|
|
||||||
let (pdu, _) = services
|
let (pdu, _) = services
|
||||||
.rooms
|
.rooms
|
||||||
@@ -67,8 +67,8 @@ pub(crate) async fn create_leave_event_template_route(
|
|||||||
.expect("Barebones PDU should be convertible to canonical JSON");
|
.expect("Barebones PDU should be convertible to canonical JSON");
|
||||||
pdu_json.remove("event_id");
|
pdu_json.remove("event_id");
|
||||||
|
|
||||||
Ok(prepare_leave_event::v1::Response {
|
Ok(prepare_leave_event::v1::Response::new(
|
||||||
room_version: Some(room_version_id),
|
Some(room_version),
|
||||||
event: to_raw_value(&pdu_json).expect("CanonicalJson can be serialized to JSON"),
|
to_raw_value(&pdu_json).expect("CanonicalJson can be serialized to JSON"),
|
||||||
})
|
))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user