summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-09-05 21:35:56 +0100
committerErik Johnston <erik@matrix.org>2014-09-05 21:35:56 +0100
commit9dd4570b68fea123fda216b8fc8625fafc9d8e0a (patch)
treebf87c16f720a7ad34d29d4b2a8b462506c919624 /synapse/api
parentMerge branch 'develop' of github.com:matrix-org/synapse into develop (diff)
downloadsynapse-9dd4570b68fea123fda216b8fc8625fafc9d8e0a.tar.xz
Generate m.room.aliases event when the HS creates a room alias
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/auth.py7
-rw-r--r--synapse/api/events/room.py7
2 files changed, 13 insertions, 1 deletions
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 {}