summary refs log tree commit diff
path: root/synapse/api/auth.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2019-03-19 11:04:12 +0000
committerRichard van der Hoff <richard@matrix.org>2019-03-19 11:30:54 +0000
commit0dbfae03f96ae14672bbdc5cf5c3aecd93636803 (patch)
treea5ed2778f54aa2da8c698bc5612402c0fdb356f9 /synapse/api/auth.py
parentComment out most options in the generated config. (#4863) (diff)
downloadsynapse-0dbfae03f96ae14672bbdc5cf5c3aecd93636803.tar.xz
Enforce hs_disabled_message correctly
Fixes a bug where hs_disabled_message was not enforced for 3pid-based requests
if there was no server_notices_mxid configured.
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r--synapse/api/auth.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py

index 5992d30623..ee646a97e8 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py
@@ -788,9 +788,11 @@ class Auth(object): # Never fail an auth check for the server notices users or support user # This can be a problem where event creation is prohibited due to blocking - is_support = yield self.store.is_support_user(user_id) - if user_id == self.hs.config.server_notices_mxid or is_support: - return + if user_id is not None: + if user_id == self.hs.config.server_notices_mxid: + return + if (yield self.store.is_support_user(user_id)): + return if self.hs.config.hs_disabled: raise ResourceLimitError(