summary refs log tree commit diff
path: root/synapse/push/__init__.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-02-25 19:17:07 +0000
committerDavid Baker <dave@matrix.org>2015-02-25 19:17:07 +0000
commit94fa334b01d232bed96fd4ee05fc44d00330c2b9 (patch)
treef680ff0fb9a16a54a083d63e44fd2d6b04093a2a /synapse/push/__init__.py
parentSYWEB-278 Don't allow rules with no rule_id. (diff)
downloadsynapse-94fa334b01d232bed96fd4ee05fc44d00330c2b9.tar.xz
Add enable/disable overlay for push rules (REST API not yet hooked up)
Diffstat (limited to 'synapse/push/__init__.py')
-rw-r--r--synapse/push/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/push/__init__.py b/synapse/push/__init__.py
index 0fb3e4f7f3..40fae91ab5 100644
--- a/synapse/push/__init__.py
+++ b/synapse/push/__init__.py
@@ -82,6 +82,8 @@ class Pusher(object):
             r['conditions'] = json.loads(r['conditions'])
             r['actions'] = json.loads(r['actions'])
 
+        enabled_map = yield self.store.get_push_rules_enabled_for_user_name(self.user_name)
+
         user = UserID.from_string(self.user_name)
 
         rules = baserules.list_with_base_rules(rawrules, user)
@@ -107,6 +109,8 @@ class Pusher(object):
             room_member_count += 1
 
         for r in rules:
+            if r['rule_id'] in enabled_map and not enabled_map[r['rule_id']]:
+                continue
             matches = True
 
             conditions = r['conditions']