summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-09-01 15:58:10 +0100
committerErik Johnston <erik@matrix.org>2015-09-01 15:58:10 +0100
commit187320b01968661e5dec4acc44b8cf55b9619997 (patch)
tree6c1f29fb8ec6122f27a1892b6d0983b76fd86126 /synapse/api
parentCheck against sender rather than event_id (diff)
parentFix tests (diff)
downloadsynapse-187320b01968661e5dec4acc44b8cf55b9619997.tar.xz
Merge branch 'erikj/check_room_exists' into erikj/unfederatable
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/auth.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 75b7c467b5..90f11fdc94 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -65,6 +65,14 @@ class Auth(object):
                 # FIXME
                 return True
 
+            creation_event = auth_events.get((EventTypes.Create, ""), None)
+
+            if not creation_event:
+                raise SynapseError(
+                    403,
+                    "Room %r does not exist" % (event.room_id,)
+                )
+
             creating_domain = RoomID.from_string(event.room_id).domain
             originating_domain = UserID.from_string(event.sender).domain
             if creating_domain != originating_domain: