diff options
author | Paul "LeoNerd" Evans <paul@matrix.org> | 2015-06-18 14:27:23 +0100 |
---|---|---|
committer | Paul "LeoNerd" Evans <paul@matrix.org> | 2015-06-18 14:27:23 +0100 |
commit | a197d2492f0e33801997c56a7c747b88ec4ec9a5 (patch) | |
tree | adf36a82d7e4a59a4d8b09ffc3d50beaa2985368 /synapse/handlers/room.py | |
parent | Since store.get_rooms() is only ever called with is_public=True, just fold th... (diff) | |
download | synapse-a197d2492f0e33801997c56a7c747b88ec4ec9a5.tar.xz |
Rename store_room()'s is_public parameter to published; default it from the badly-named "visiblity" parameter but allow a new "published" to override it
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r-- | synapse/handlers/room.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index 39e3e1d22b..38d07a43f0 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -77,6 +77,14 @@ class RoomCreationHandler(BaseHandler): is_public = config.get("visibility", None) == "public" + # By default, all public-joinable rooms are published. Allow overriding + # that decision. + # TODO(paul): Specify 'published' key + if "published" in config: + published = config["published"] + else: + published = is_public + if room_id: # Ensure room_id is the correct type room_id_obj = RoomID.from_string(room_id) @@ -86,7 +94,7 @@ class RoomCreationHandler(BaseHandler): yield self.store.store_room( room_id=room_id, room_creator_user_id=user_id, - is_public=is_public + published=published, ) else: # autogen room IDs and try to create it. We may clash, so just @@ -103,7 +111,7 @@ class RoomCreationHandler(BaseHandler): yield self.store.store_room( room_id=gen_room_id.to_string(), room_creator_user_id=user_id, - is_public=is_public + published=published, ) room_id = gen_room_id.to_string() break |