Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 40c2271

Browse files
committed
Clean up room chunk logic
1 parent 6728bf3 commit 40c2271

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

synapse/handlers/room_list.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,15 @@ def _append_room_entry_to_chunk(self, room_id, num_joined_users, chunk, limit,
327327
return
328328

329329
result = yield self.generate_room_entry(room_id, num_joined_users)
330+
if not result:
331+
return
330332

331-
if from_federation:
332-
if not result or result["m.federate"] is False:
333-
# This is a non-federating room and the config has chosen not
334-
# to show these rooms to other servers
335-
return
336-
elif result and _matches_room_entry(result, search_filter):
333+
if from_federation and result["m.federate"] is False:
334+
# This is a room that other servers cannot join. Do not show them
335+
# this room.
336+
return
337+
338+
if _matches_room_entry(result, search_filter):
337339
chunk.append(result)
338340

339341
@cachedInlineCallbacks(num_args=2, cache_context=True)

0 commit comments

Comments
 (0)