From 345ff2196a8b381a3dfea537ab659aac0837045a Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 18 Jan 2016 14:39:34 +0000 Subject: Don't edit ruleset --- synapse/push/push_rule_evaluator.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'synapse') diff --git a/synapse/push/push_rule_evaluator.py b/synapse/push/push_rule_evaluator.py index bbc8308c2d..60d9f1f239 100644 --- a/synapse/push/push_rule_evaluator.py +++ b/synapse/push/push_rule_evaluator.py @@ -131,11 +131,10 @@ class PushRuleEvaluator: evaluator = PushRuleEvaluatorForEvent.create(ev, room_member_count) for r in self.rules: - if r['rule_id'] in self.enabled_map: - r['enabled'] = self.enabled_map[r['rule_id']] - elif 'enabled' not in r: - r['enabled'] = True - if not r['enabled']: + if self.enabled_map.get(r['rule_id'], None) is False: + continue + + if not r.get("enabled", True): continue conditions = r['conditions'] -- cgit 1.4.1