mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
Merge pull request #522 from matrix-org/dbkr/no_push_unless_notify
Don't add notifications to the table unless there's actually a 'notify' action
This commit is contained in:
commit
0e0e441b33
@ -139,8 +139,16 @@ class BulkPushRuleEvaluator:
|
||||
evaluator, rule['conditions'], uid, display_name, condition_cache
|
||||
)
|
||||
if matches:
|
||||
notify = False
|
||||
actions = []
|
||||
for a in rule['actions']:
|
||||
if a != 'dont_notify':
|
||||
actions.append(a)
|
||||
elif a == 'notify':
|
||||
notify = True
|
||||
|
||||
actions = [x for x in rule['actions'] if x != 'dont_notify']
|
||||
if actions:
|
||||
if actions and notify:
|
||||
actions_by_user[uid] = actions
|
||||
break
|
||||
defer.returnValue(actions_by_user)
|
||||
|
Loading…
Reference in New Issue
Block a user