diff --git a/synapse/push/baserules.py b/synapse/push/baserules.py
index 286374d0b5..204d2d83f6 100644
--- a/synapse/push/baserules.py
+++ b/synapse/push/baserules.py
@@ -335,7 +335,11 @@ BASE_APPEND_UNDERRIDE_RULES = [
"_id": "_message",
}
],
- "actions": ["notify", {"set_tweak": "highlight", "value": False}],
+ "actions": [
+ "notify",
+ {"set_tweak": "sound", "value": "default"},
+ {"set_tweak": "highlight", "value": False},
+ ],
},
# XXX: this is going to fire for events which aren't m.room.messages
# but are encrypted (e.g. m.call.*)...
@@ -349,7 +353,11 @@ BASE_APPEND_UNDERRIDE_RULES = [
"_id": "_encrypted",
}
],
- "actions": ["notify", {"set_tweak": "highlight", "value": False}],
+ "actions": [
+ "notify",
+ {"set_tweak": "sound", "value": "default"},
+ {"set_tweak": "highlight", "value": False},
+ ],
},
]
diff --git a/synapse/push/pusherpool.py b/synapse/push/pusherpool.py
index 3c3262a88c..305fd00fc0 100644
--- a/synapse/push/pusherpool.py
+++ b/synapse/push/pusherpool.py
@@ -64,6 +64,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]]]
@@ -190,6 +192,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 = await 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)
@@ -210,6 +220,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)
|