mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-15 07:33:50 +01:00
Ensure published rooms have public join rules
This commit is contained in:
parent
0677fc1c4e
commit
b2802a1351
1 changed files with 7 additions and 0 deletions
|
@ -953,6 +953,13 @@ class RoomListHandler(BaseHandler):
|
|||
def get_state(etype, state_key):
|
||||
return self.state_handler.get_current_state(room_id, etype, state_key)
|
||||
|
||||
# Double check that this is actually a public room.
|
||||
join_rules_event = yield get_state(EventTypes.JoinRules, "")
|
||||
if join_rules_event:
|
||||
join_rule = join_rules_event.content.get("join_rule", None)
|
||||
if join_rule and join_rule != JoinRules.PUBLIC:
|
||||
defer.returnValue(None)
|
||||
|
||||
result = {"room_id": room_id}
|
||||
if aliases:
|
||||
result["aliases"] = aliases
|
||||
|
|
Loading…
Reference in a new issue