From eecc2b6296133382bbb39512a955dade1371fb07 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 17 Sep 2016 01:40:31 +0100 Subject: [PATCH] i think this fixes the room pagination limit. rather than aborting on the final partial pagination, it instead paginates the remainder, and then aborts if you try to go any further. --- synapse/handlers/room_list.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/synapse/handlers/room_list.py b/synapse/handlers/room_list.py index f15987b265..28c7523b7c 100644 --- a/synapse/handlers/room_list.py +++ b/synapse/handlers/room_list.py @@ -238,9 +238,12 @@ class RoomListHandler(BaseHandler): addition *= -1 try: - new_limit = sorted_rooms.index(last_room_id) + addition - if new_limit >= len(sorted_rooms): + if sorted_rooms.index(last_room_id) == len(sorted_rooms): new_limit = None + else: + new_limit = sorted_rooms.index(last_room_id) + addition + if new_limit >= len(sorted_rooms): + new_limit = len(sorted_rooms) except ValueError: pass