summary refs log tree commit diff
path: root/synapse/handlers/room.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-09-03 18:26:10 +0100
committerErik Johnston <erik@matrix.org>2014-09-03 18:52:34 +0100
commitdce63953950ce1026e64375222f1cc34e67f20e9 (patch)
tree66ba95603e40c478638d40b512b8d2199fc7c35e /synapse/handlers/room.py
parentAdded more ng-if to make nice sentences like "Bob kicked Alice" or "Bob unba... (diff)
downloadsynapse-dce63953950ce1026e64375222f1cc34e67f20e9.tar.xz
When creating a room and a user supplies a room_alias but no name, use the room_alias as the name.
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r--synapse/handlers/room.py11
1 files changed, 11 insertions, 0 deletions
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
@@ -137,6 +137,17 @@ class RoomCreationHandler(BaseRoomHandler):
             )
 
             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:
             topic = config["topic"]