diff options
author | Erik Johnston <erikj@jki.re> | 2016-09-15 13:27:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-15 13:27:09 +0100 |
commit | e457034e99d46d32e3d71eddb12cda07d8a0370e (patch) | |
tree | 2b3cc4cbf5a17a6de91c6f07e47b038b22186921 /synapse/federation/transport/server.py | |
parent | Merge pull request #1117 from matrix-org/erikj/fix_state (diff) | |
parent | By default limit /publicRooms to 100 entries (diff) | |
download | synapse-e457034e99d46d32e3d71eddb12cda07d8a0370e.tar.xz |
Merge pull request #1121 from matrix-org/erikj/public_room_paginate
Add pagination support to publicRooms
Diffstat (limited to 'synapse/federation/transport/server.py')
-rw-r--r-- | synapse/federation/transport/server.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/federation/transport/server.py b/synapse/federation/transport/server.py index 37c0d4fbc4..fec337be64 100644 --- a/synapse/federation/transport/server.py +++ b/synapse/federation/transport/server.py @@ -18,7 +18,9 @@ from twisted.internet import defer from synapse.api.urls import FEDERATION_PREFIX as PREFIX from synapse.api.errors import Codes, SynapseError from synapse.http.server import JsonResource -from synapse.http.servlet import parse_json_object_from_request +from synapse.http.servlet import ( + parse_json_object_from_request, parse_integer_from_args, parse_string_from_args, +) from synapse.util.ratelimitutils import FederationRateLimiter from synapse.util.versionstring import get_version_string @@ -554,7 +556,11 @@ class PublicRoomList(BaseFederationServlet): @defer.inlineCallbacks def on_GET(self, origin, content, query): - data = yield self.room_list_handler.get_local_public_room_list() + limit = parse_integer_from_args(query, "limit", 0) + since_token = parse_string_from_args(query, "since", None) + data = yield self.room_list_handler.get_local_public_room_list( + limit, since_token + ) defer.returnValue((200, data)) |