add some accessors to Ar for common patterns
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -14,12 +14,10 @@ use crate::{Result, Ruma};
|
||||
pub(crate) async fn get_room_state_ids_route(
|
||||
State(services): State<crate::State>, body: Ruma<get_room_state_ids::v1::Request>,
|
||||
) -> Result<get_room_state_ids::v1::Response> {
|
||||
let origin = body.origin.as_ref().expect("server is authenticated");
|
||||
|
||||
services
|
||||
.rooms
|
||||
.event_handler
|
||||
.acl_check(origin, &body.room_id)
|
||||
.acl_check(body.origin(), &body.room_id)
|
||||
.await?;
|
||||
|
||||
if !services
|
||||
@@ -29,7 +27,7 @@ pub(crate) async fn get_room_state_ids_route(
|
||||
.await && !services
|
||||
.rooms
|
||||
.state_cache
|
||||
.server_in_room(origin, &body.room_id)
|
||||
.server_in_room(body.origin(), &body.room_id)
|
||||
.await
|
||||
{
|
||||
return Err!(Request(Forbidden("Server is not in room.")));
|
||||
|
||||
Reference in New Issue
Block a user