When creating a room and a user supplies a room_alias but no name, use the room_alias as the name.

This commit is contained in:
Erik Johnston 2014-09-03 18:26:10 +01:00
parent 6322aa154b
commit dce6395395
1 changed files with 11 additions and 0 deletions

View File

@ -136,6 +136,17 @@ class RoomCreationHandler(BaseRoomHandler):
content={"name": name}, 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) yield handle_event(name_event)
if "topic" in config: if "topic" in config: