From 9dd4570b68fea123fda216b8fc8625fafc9d8e0a Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 5 Sep 2014 21:35:56 +0100 Subject: Generate m.room.aliases event when the HS creates a room alias --- synapse/api/auth.py | 7 ++++++- synapse/api/events/room.py | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'synapse/api') diff --git a/synapse/api/auth.py b/synapse/api/auth.py index 5d7c607702..df61794551 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py @@ -327,6 +327,11 @@ class Auth(object): event.state_key, ) + if not current_state: + return + else: + current_state = current_state[0] + user_level = yield self.store.get_power_level( event.room_id, event.user_id, @@ -341,7 +346,7 @@ class Auth(object): # FIXME (erikj) old_people = {k: v for k, v in old_list.items() if k.startswith("@")} - new_people = {k: v for k, v in event.content if k.startswith("@")} + new_people = {k: v for k, v in event.content.items() if k.startswith("@")} removed = set(old_people.keys()) - set(new_people.keys()) added = set(old_people.keys()) - set(new_people.keys()) diff --git a/synapse/api/events/room.py b/synapse/api/events/room.py index 33f0f0cb99..3a4dbc58ce 100644 --- a/synapse/api/events/room.py +++ b/synapse/api/events/room.py @@ -173,3 +173,10 @@ class RoomOpsPowerLevelsEvent(SynapseStateEvent): def get_content_template(self): return {} + + +class RoomAliasesEvent(SynapseStateEvent): + TYPE = "m.room.aliases" + + def get_content_template(self): + return {} -- cgit 1.4.1