Merge pull request #3753 from matrix-org/erikj/fix_no_server_noticse

Fix bug where we broke sync when using limit_usage_by_mau
This commit is contained in:
Erik Johnston 2018-08-24 11:56:08 +01:00 committed by GitHub
commit 92d50e3c2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

1
changelog.d/3753.bugfix Normal file
View File

@ -0,0 +1 @@
Fix bug where we broke sync when using limit_usage_by_mau but hadn't configured server notices

View File

@ -66,6 +66,10 @@ class ResourceLimitsServerNotices(object):
if self._config.limit_usage_by_mau is False:
return
if not self._server_notices_manager.is_enabled():
# Don't try and send server notices unles they've been enabled
return
timestamp = yield self._store.user_last_seen_monthly_active(user_id)
if timestamp is None:
# This user will be blocked from receiving the notice anyway.