From dce63953950ce1026e64375222f1cc34e67f20e9 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 3 Sep 2014 18:26:10 +0100 Subject: [PATCH] When creating a room and a user supplies a room_alias but no name, use the room_alias as the name. --- synapse/handlers/room.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index 64956c320c..8171e9eb45 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -136,6 +136,17 @@ class RoomCreationHandler(BaseRoomHandler): content={"name": name}, ) + yield handle_event(name_event) + elif room_alias: + name = room_alias.to_string() + name_event = self.event_factory.create_event( + etype=RoomNameEvent.TYPE, + room_id=room_id, + user_id=user_id, + required_power_level=5, + content={"name": name}, + ) + yield handle_event(name_event) if "topic" in config: