summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-09-01 15:57:35 +0100
committerErik Johnston <erik@matrix.org>2015-09-01 15:57:35 +0100
commitb345853918b9300bdde19010d29bf66973497de7 (patch)
treef21c7d4bc77b933e56d4d60c660d3e12f7bd90c1 /synapse/api
parentAdd flag which disables federation of the room (diff)
downloadsynapse-b345853918b9300bdde19010d29bf66973497de7.tar.xz
Check against sender rather than event_id
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/auth.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index f7cf17e433..75b7c467b5 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -20,7 +20,7 @@ from twisted.internet import defer
 from synapse.api.constants import EventTypes, Membership, JoinRules
 from synapse.api.errors import AuthError, Codes, SynapseError
 from synapse.util.logutils import log_function
-from synapse.types import EventID, RoomID, UserID
+from synapse.types import RoomID, UserID
 
 import logging
 
@@ -66,10 +66,10 @@ class Auth(object):
                 return True
 
             creating_domain = RoomID.from_string(event.room_id).domain
-            originating_domain = EventID.from_string(event.event_id).domain
+            originating_domain = UserID.from_string(event.sender).domain
             if creating_domain != originating_domain:
                 if not self.can_federate(event, auth_events):
-                    raise SynapseError(
+                    raise AuthError(
                         403,
                         "This room has been marked as unfederatable."
                     )