summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-09-16 10:24:15 +0100
committerErik Johnston <erik@matrix.org>2016-09-16 10:24:15 +0100
commit23b6701a2869d50fefbc949fbb449de07636b5b8 (patch)
tree6862ca745814351a0dc606554fbf5514b76ed5e2 /synapse/handlers
parentFilter remote rooms lists locally (diff)
downloadsynapse-23b6701a2869d50fefbc949fbb449de07636b5b8.tar.xz
Support filtering remote room lists
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/room_list.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/synapse/handlers/room_list.py b/synapse/handlers/room_list.py
index 9383f2486c..09189edb65 100644
--- a/synapse/handlers/room_list.py
+++ b/synapse/handlers/room_list.py
@@ -280,17 +280,23 @@ class RoomListHandler(BaseHandler):
     @defer.inlineCallbacks
     def get_remote_public_room_list(self, server_name, limit=None, since_token=None,
                                     search_filter=None):
+        if search_filter:
+            # We currently don't support searching across federation, so we have
+            # to do it manually without pagination
+            limit = None
+            since_token = None
+
         res = yield self.hs.get_replication_layer().get_public_rooms(
             server_name, limit=limit, since_token=since_token,
             search_filter=search_filter,
         )
 
         if search_filter:
-            res["chunk"] = [
+            res = {"chunk": [
                 entry
-                for entry in dict(res.get("chunk", []))
+                for entry in list(res.get("chunk", []))
                 if _matches_room_entry(entry, search_filter)
-            ]
+            ]}
 
         defer.returnValue(res)