diff options
author | David Baker <dave@matrix.org> | 2016-01-22 16:56:48 +0000 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2016-01-22 16:56:48 +0000 |
commit | b4a41aa542203c03bb8a6c93097b94bc5d167265 (patch) | |
tree | dacee2bc908bcb567e47041cba6219b4fe2044ac | |
parent | Merge pull request #520 from matrix-org/dbkr/bulk_push_overlay_enabled (diff) | |
download | synapse-b4a41aa542203c03bb8a6c93097b94bc5d167265.tar.xz |
Don't add notifications to the table unless there's actually a 'notify' action
-rw-r--r-- | synapse/push/bulk_push_rule_evaluator.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/push/bulk_push_rule_evaluator.py b/synapse/push/bulk_push_rule_evaluator.py index 06250d2d96..c4cc85eb4b 100644 --- a/synapse/push/bulk_push_rule_evaluator.py +++ b/synapse/push/bulk_push_rule_evaluator.py @@ -135,8 +135,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) |