mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix: Don't serve events over s2s that are rejected
This commit is contained in:
@@ -22,6 +22,15 @@ pub(crate) async fn get_event_route(
|
|||||||
.await
|
.await
|
||||||
.map_err(|_| err!(Request(NotFound("Event not found."))))?;
|
.map_err(|_| err!(Request(NotFound("Event not found."))))?;
|
||||||
|
|
||||||
|
if services
|
||||||
|
.rooms
|
||||||
|
.pdu_metadata
|
||||||
|
.is_event_rejected(&body.event_id)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
return Err!(Request(NotFound("Event not found.")));
|
||||||
|
}
|
||||||
|
|
||||||
let room_id: &RoomId = event
|
let room_id: &RoomId = event
|
||||||
.get("room_id")
|
.get("room_id")
|
||||||
.and_then(|val| val.as_str())
|
.and_then(|val| val.as_str())
|
||||||
|
|||||||
@@ -26,6 +26,15 @@ pub(crate) async fn get_event_authorization_route(
|
|||||||
.check()
|
.check()
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
if services
|
||||||
|
.rooms
|
||||||
|
.pdu_metadata
|
||||||
|
.is_event_rejected(&body.event_id)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
return Err!(Request(NotFound("Event not found.")));
|
||||||
|
}
|
||||||
|
|
||||||
if !services
|
if !services
|
||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
|
|||||||
@@ -78,6 +78,15 @@ pub(crate) async fn get_missing_events_route(
|
|||||||
body.room_id
|
body.room_id
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
|
if services
|
||||||
|
.rooms
|
||||||
|
.pdu_metadata
|
||||||
|
.is_event_rejected(pdu.event_id())
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
debug!(%next_event_id, "event rejected, not traversing");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if !services
|
if !services
|
||||||
.rooms
|
.rooms
|
||||||
|
|||||||
@@ -24,6 +24,15 @@ pub(crate) async fn get_room_state_route(
|
|||||||
.check()
|
.check()
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
if services
|
||||||
|
.rooms
|
||||||
|
.pdu_metadata
|
||||||
|
.is_event_rejected(&body.event_id)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
return Err!(Request(NotFound("Event not found.")));
|
||||||
|
}
|
||||||
|
|
||||||
if !services
|
if !services
|
||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
|
|||||||
@@ -25,6 +25,15 @@ pub(crate) async fn get_room_state_ids_route(
|
|||||||
.check()
|
.check()
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
if services
|
||||||
|
.rooms
|
||||||
|
.pdu_metadata
|
||||||
|
.is_event_rejected(&body.event_id)
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
return Err!(Request(NotFound("Event not found.")));
|
||||||
|
}
|
||||||
|
|
||||||
if !services
|
if !services
|
||||||
.rooms
|
.rooms
|
||||||
.state_cache
|
.state_cache
|
||||||
|
|||||||
Reference in New Issue
Block a user