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.
This commit is contained in:
Richard van der Hoff 2019-03-19 11:04:12 +00:00
parent fd463b4f5d
commit 0dbfae03f9
3 changed files with 24 additions and 3 deletions

View file

@ -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(