mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-19 16:51:24 +01:00
limit total events examined in /messages
This commit is contained in:
parent
93ad93a36b
commit
2bcd357db2
2 changed files with 20 additions and 1 deletions
|
|
@ -15,7 +15,7 @@ use ruma::{
|
|||
use crate::{
|
||||
service::{pdu::PduBuilder, rooms::timeline::PduCount},
|
||||
services, utils,
|
||||
utils::filter::CompiledRoomEventFilter,
|
||||
utils::filter::{load_limit, CompiledRoomEventFilter},
|
||||
Ar, Error, Ra, Result,
|
||||
};
|
||||
|
||||
|
|
@ -194,6 +194,7 @@ pub(crate) async fn get_message_events_route(
|
|||
.rooms
|
||||
.timeline
|
||||
.pdus_after(sender_user, &body.room_id, from)?
|
||||
.take(load_limit(limit))
|
||||
.filter_map(Result::ok)
|
||||
.filter(|(_, pdu)| {
|
||||
services()
|
||||
|
|
@ -250,6 +251,7 @@ pub(crate) async fn get_message_events_route(
|
|||
.rooms
|
||||
.timeline
|
||||
.pdus_until(sender_user, &body.room_id, from)?
|
||||
.take(load_limit(limit))
|
||||
.filter_map(Result::ok)
|
||||
.filter(|(_, pdu)| {
|
||||
services()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue