summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-03-20 17:08:36 +0000
committerErik Johnston <erik@matrix.org>2019-03-20 17:08:36 +0000
commit7d47cc1305e1504af78ff13c49b43b81b1ac5791 (patch)
tree41f0e93c6e348b90a600a2e59dddc8c1b65c53b5 /synapse
parentNewsfile (diff)
downloadsynapse-7d47cc1305e1504af78ff13c49b43b81b1ac5791.tar.xz
Move requester check into assert_accepted_privacy_policy
Diffstat (limited to 'synapse')
-rw-r--r--synapse/handlers/message.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py
index ac9d9c1a83..345a3e0ecd 100644
--- a/synapse/handlers/message.py
+++ b/synapse/handlers/message.py
@@ -316,12 +316,8 @@ class EventCreationHandler(object):
                         target, e
                     )
 
-        # Check if the user has accepted the privacy policy. We only do this if
-        # the requester has an associated access_token_id, which indicates that
-        # this action came from a user request rather than an automatice server
-        # or admin action.
         is_exempt = yield self._is_exempt_from_privacy_policy(builder, requester)
-        if requester.access_token_id and not is_exempt:
+        if not is_exempt:
             yield self.assert_accepted_privacy_policy(requester)
 
         if token_id is not None:
@@ -396,6 +392,13 @@ class EventCreationHandler(object):
         if requester.app_service is not None:
             return
 
+        # Check if the user has accepted the privacy policy. We only do this if
+        # the requester has an associated access_token_id, which indicates that
+        # this action came from a user request rather than an automatice server
+        # or admin action.
+        if requester.access_token_id is None:
+            return
+
         user_id = requester.user.to_string()
 
         # exempt the system notices user