mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2024-11-27 20:45:30 +00:00
fix(fed): dont reject /get_missing_events
on world readable rooms
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
bfbb29dded
commit
81487e3f07
|
@ -13,19 +13,23 @@ pub(crate) async fn get_missing_events_route(
|
||||||
) -> Result<get_missing_events::v1::Response> {
|
) -> Result<get_missing_events::v1::Response> {
|
||||||
let origin = body.origin.as_ref().expect("server is authenticated");
|
let origin = body.origin.as_ref().expect("server is authenticated");
|
||||||
|
|
||||||
if !services()
|
|
||||||
.rooms
|
|
||||||
.state_cache
|
|
||||||
.server_in_room(origin, &body.room_id)?
|
|
||||||
{
|
|
||||||
return Err(Error::BadRequest(ErrorKind::forbidden(), "Server is not in room"));
|
|
||||||
}
|
|
||||||
|
|
||||||
services()
|
services()
|
||||||
.rooms
|
.rooms
|
||||||
.event_handler
|
.event_handler
|
||||||
.acl_check(origin, &body.room_id)?;
|
.acl_check(origin, &body.room_id)?;
|
||||||
|
|
||||||
|
if !services()
|
||||||
|
.rooms
|
||||||
|
.state_accessor
|
||||||
|
.is_world_readable(&body.room_id)?
|
||||||
|
&& !services()
|
||||||
|
.rooms
|
||||||
|
.state_cache
|
||||||
|
.server_in_room(origin, &body.room_id)?
|
||||||
|
{
|
||||||
|
return Err(Error::BadRequest(ErrorKind::forbidden(), "Server is not in room"));
|
||||||
|
}
|
||||||
|
|
||||||
let limit = body
|
let limit = body
|
||||||
.limit
|
.limit
|
||||||
.try_into()
|
.try_into()
|
||||||
|
|
Loading…
Reference in a new issue