summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-24 12:56:17 +0000
committerErik Johnston <erik@matrix.org>2014-11-24 12:56:17 +0000
commit4bd0ab76c69b8f4861de26894f8e50407e9fc87f (patch)
treeefb13721713d72d91d8f6c7e6574db2a9c6be875 /synapse/handlers
parentSYN-163: Add an order by rowid to selects. (diff)
downloadsynapse-4bd0ab76c69b8f4861de26894f8e50407e9fc87f.tar.xz
We don't always want to Auth get_persisted_pdu
Diffstat (limited to '')
-rw-r--r--synapse/handlers/federation.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 2e8b8a1f9a..f601de4488 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -529,7 +529,7 @@ class FederationHandler(BaseHandler):
 
     @defer.inlineCallbacks
     @log_function
-    def get_persisted_pdu(self, origin, event_id):
+    def get_persisted_pdu(self, origin, event_id, do_auth=True):
         """ Get a PDU from the database with given origin and id.
 
         Returns:
@@ -541,12 +541,13 @@ class FederationHandler(BaseHandler):
         )
 
         if event:
-            in_room = yield self.auth.check_host_in_room(
-                event.room_id,
-                origin
-            )
-            if not in_room:
-                raise AuthError(403, "Host not in room.")
+            if do_auth:
+                in_room = yield self.auth.check_host_in_room(
+                    event.room_id,
+                    origin
+                )
+                if not in_room:
+                    raise AuthError(403, "Host not in room.")
 
             defer.returnValue(event)
         else: