aboutsummaryrefslogtreecommitdiff
path: root/syncapi/routing/messages.go
diff options
context:
space:
mode:
Diffstat (limited to 'syncapi/routing/messages.go')
-rw-r--r--syncapi/routing/messages.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/syncapi/routing/messages.go b/syncapi/routing/messages.go
index e294c880..ba739148 100644
--- a/syncapi/routing/messages.go
+++ b/syncapi/routing/messages.go
@@ -235,12 +235,15 @@ func (r *messagesReq) retrieveEvents() (
clientEvents []gomatrixserverlib.ClientEvent, start,
end types.TopologyToken, err error,
) {
+ eventFilter := gomatrixserverlib.DefaultRoomEventFilter()
+ eventFilter.Limit = r.limit
+
// Retrieve the events from the local database.
var streamEvents []types.StreamEvent
if r.fromStream != nil {
toStream := r.to.StreamToken()
streamEvents, err = r.db.GetEventsInStreamingRange(
- r.ctx, r.fromStream, &toStream, r.roomID, r.limit, r.backwardOrdering,
+ r.ctx, r.fromStream, &toStream, r.roomID, &eventFilter, r.backwardOrdering,
)
} else {
streamEvents, err = r.db.GetEventsInTopologicalRange(