Respect 'limit' param in initialSync api

This commit is contained in:
Erik Johnston 2014-08-26 16:26:30 +01:00
parent d0103400b5
commit 9a93e83d90
1 changed files with 5 additions and 1 deletions

View File

@ -270,6 +270,10 @@ class MessageHandler(BaseHandler):
# FIXME (erikj): We need to not generate this token, # FIXME (erikj): We need to not generate this token,
now_token = "%s_%s" % (now_rooms_token, now_presence_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: for event in room_list:
d = { d = {
"room_id": event.room_id, "room_id": event.room_id,
@ -286,7 +290,7 @@ class MessageHandler(BaseHandler):
try: try:
messages, token = yield self.store.get_recent_events_for_room( messages, token = yield self.store.get_recent_events_for_room(
event.room_id, event.room_id,
limit=10, limit=limit,
end_token=now_rooms_token, end_token=now_rooms_token,
) )