mirror of
https://github.com/element-hq/synapse
synced 2024-09-03 22:30:06 +00:00
Merge pull request #523 from matrix-org/dbkr/no_push_unless_notify
Better fix for actions with both dont_notify and tweaks
This commit is contained in:
commit
f92fe15897
1 changed files with 1 additions and 9 deletions
|
@ -139,16 +139,8 @@ 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 and notify:
|
if actions and 'notify' in actions:
|
||||||
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 a new issue