diff options
author | Erik Johnston <erikj@jki.re> | 2018-08-24 11:56:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-24 11:56:08 +0100 |
commit | 92d50e3c2aef0245fe5edc715667cc3912183724 (patch) | |
tree | 934e3fa0bbccdd1b448e8bf2572ab63ed8cb22e4 | |
parent | Merge pull request #3751 from matrix-org/rav/twisted_17 (diff) | |
parent | Newsfile (diff) | |
download | synapse-92d50e3c2aef0245fe5edc715667cc3912183724.tar.xz |
Merge pull request #3753 from matrix-org/erikj/fix_no_server_noticse
Fix bug where we broke sync when using limit_usage_by_mau
-rw-r--r-- | changelog.d/3753.bugfix | 1 | ||||
-rw-r--r-- | synapse/server_notices/resource_limits_server_notices.py | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/changelog.d/3753.bugfix b/changelog.d/3753.bugfix new file mode 100644 index 0000000000..b4301267df --- /dev/null +++ b/changelog.d/3753.bugfix @@ -0,0 +1 @@ +Fix bug where we broke sync when using limit_usage_by_mau but hadn't configured server notices diff --git a/synapse/server_notices/resource_limits_server_notices.py b/synapse/server_notices/resource_limits_server_notices.py index 96eb97771f..98495ddbf9 100644 --- a/synapse/server_notices/resource_limits_server_notices.py +++ b/synapse/server_notices/resource_limits_server_notices.py @@ -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. |