summary refs log tree commit diff
path: root/synapse/push/pusherpool.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/push/pusherpool.py')
-rw-r--r--synapse/push/pusherpool.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/synapse/push/pusherpool.py b/synapse/push/pusherpool.py

index 2456f12f46..7c5e47bc81 100644 --- a/synapse/push/pusherpool.py +++ b/synapse/push/pusherpool.py
@@ -66,6 +66,8 @@ class PusherPool: self._pusher_shard_config = hs.config.push.pusher_shard_config self._instance_name = hs.get_instance_name() + self._account_validity = hs.config.account_validity + # map from user id to app_id:pushkey to pusher self.pushers = {} # type: Dict[str, Dict[str, Union[HttpPusher, EmailPusher]]] @@ -196,6 +198,14 @@ class PusherPool: for u in users_affected: if u in self.pushers: + # Don't push if the user account has expired + if self._account_validity.enabled: + expired = yield self.store.is_account_expired( + u, self.clock.time_msec() + ) + if expired: + continue + for p in self.pushers[u].values(): p.on_new_notifications(min_stream_id, max_stream_id) @@ -217,6 +227,14 @@ class PusherPool: for u in users_affected: if u in self.pushers: + # Don't push if the user account has expired + if self._account_validity.enabled: + expired = yield self.store.is_account_expired( + u, self.clock.time_msec() + ) + if expired: + continue + for p in self.pushers[u].values(): p.on_new_receipts(min_stream_id, max_stream_id)