summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2019-02-26 12:04:34 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2019-02-26 12:04:34 +0000
commit40c2271680501c5ca2c29349d62df42d80b953db (patch)
tree9febcadeba03b68a1420ff0273ce86a65d33a5df
parentMake not showing non-federated rooms the default (diff)
downloadsynapse-40c2271680501c5ca2c29349d62df42d80b953db.tar.xz
Clean up room chunk logic
-rw-r--r--synapse/handlers/room_list.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/synapse/handlers/room_list.py b/synapse/handlers/room_list.py
index f1a51a7ca9..e6038a1069 100644
--- a/synapse/handlers/room_list.py
+++ b/synapse/handlers/room_list.py
@@ -327,13 +327,15 @@ class RoomListHandler(BaseHandler):
             return
 
         result = yield self.generate_room_entry(room_id, num_joined_users)
+        if not result:
+            return
 
-        if from_federation:
-            if not result or result["m.federate"] is False:
-                # This is a non-federating room and the config has chosen not
-                # to show these rooms to other servers
-                return
-        elif result and _matches_room_entry(result, search_filter):
+        if from_federation and result["m.federate"] is False:
+            # This is a room that other servers cannot join. Do not show them
+            # this room.
+            return
+
+        if _matches_room_entry(result, search_filter):
             chunk.append(result)
 
     @cachedInlineCallbacks(num_args=2, cache_context=True)