From 9a93e83d9007706df019f6f3b046e9332f3e9340 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Tue, 26 Aug 2014 16:26:30 +0100 Subject: [PATCH] Respect 'limit' param in initialSync api --- synapse/handlers/room.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index c2b10f418..5a4569ac9 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -270,6 +270,10 @@ class MessageHandler(BaseHandler): # FIXME (erikj): We need to not generate this token, now_token = "%s_%s" % (now_rooms_token, now_presence_token) + limit = pagin_config.limit + if not limit: + limit = 10 + for event in room_list: d = { "room_id": event.room_id, @@ -286,7 +290,7 @@ class MessageHandler(BaseHandler): try: messages, token = yield self.store.get_recent_events_for_room( event.room_id, - limit=10, + limit=limit, end_token=now_rooms_token, )