summary refs log tree commit diff
path: root/synapse/api/auth.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-01-07 16:09:00 +0000
committerKegan Dougal <kegan@matrix.org>2015-01-07 16:09:00 +0000
commit4c68460392ef032b156b8d006f4aec5496ceedcb (patch)
tree29e51118deba86377b44aa0b3220b2cb2568670b /synapse/api/auth.py
parentSYN-154: Better error messages when joining an unknown room by ID. (diff)
downloadsynapse-4c68460392ef032b156b8d006f4aec5496ceedcb.tar.xz
SYN-154: Tweak how the m.room.create check is done.
Don't perform the check in auth.is_host_in_room but instead do it in _do_join
and also assert that there are no m.room.members in the room before doing so.
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r--synapse/api/auth.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 8a3455ec54..e31482cfaa 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -98,16 +98,7 @@ class Auth(object):
         defer.returnValue(member)
 
     @defer.inlineCallbacks
-    def check_host_in_room(self, room_id, host, context=None):
-        if context:
-            # XXX: check_host_in_room should really return True for a new
-            # room created by this home server. There are no m.room.member
-            # join events yet so we need to check for the m.room.create event
-            # instead.
-            if (u"m.room.create", u"") in context.auth_events:
-                defer.returnValue(True)
-                return
-
+    def check_host_in_room(self, room_id, host):
         curr_state = yield self.state.get_current_state(room_id)
 
         for event in curr_state: