mirror of
https://mau.dev/maunium/synapse.git
synced 2024-09-06 01:22:16 +00:00
Don't add notifications to the table unless there's actually a 'notify' action
This commit is contained in:
parent
74f49f99f9
commit
b4a41aa542
@ -135,8 +135,16 @@ class BulkPushRuleEvaluator:
|
|||||||
evaluator, rule['conditions'], uid, display_name, condition_cache
|
evaluator, rule['conditions'], uid, display_name, condition_cache
|
||||||
)
|
)
|
||||||
if matches:
|
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']
|
actions = [x for x in rule['actions'] if x != 'dont_notify']
|
||||||
if actions:
|
if actions and notify:
|
||||||
actions_by_user[uid] = actions
|
actions_by_user[uid] = actions
|
||||||
break
|
break
|
||||||
defer.returnValue(actions_by_user)
|
defer.returnValue(actions_by_user)
|
||||||
|
Loading…
Reference in New Issue
Block a user