diff options
author | Erik Johnston <erik@matrix.org> | 2016-03-23 13:45:57 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-03-23 13:59:31 +0000 |
commit | b2802a1351cf5dbfb68d0e0f96ad9fb16df98fe8 (patch) | |
tree | e4baf9277898639331ac0e21100e27ee05864df9 /synapse | |
parent | Comment (diff) | |
download | synapse-b2802a1351cf5dbfb68d0e0f96ad9fb16df98fe8.tar.xz |
Ensure published rooms have public join rules
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/handlers/room.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index 25225ea1c4..7062414adf 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -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 |