summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-03-10 17:26:25 +0000
committerDavid Baker <dave@matrix.org>2015-03-10 17:26:25 +0000
commit04f8478aaa02d11ce079d1eaeabcfba88b1fcee7 (patch)
tree5ca8117876ce9507421c5e4c53c117a7171e6577 /synapse/rest
parentThese aren't defined for redacted events so don't crash (diff)
downloadsynapse-04f8478aaa02d11ce079d1eaeabcfba88b1fcee7.tar.xz
Add the master push rule for the break-my-push button. Allow server default rules to be disabled by default.
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/client/v1/push_rule.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/rest/client/v1/push_rule.py b/synapse/rest/client/v1/push_rule.py
index fef0eb6572..d4e7ab2202 100644
--- a/synapse/rest/client/v1/push_rule.py
+++ b/synapse/rest/client/v1/push_rule.py
@@ -156,9 +156,12 @@ class PushRuleRestServlet(ClientV1RestServlet):
 
             template_rule = _rule_to_template(r)
             if template_rule:
-                template_rule['enabled'] = True
                 if r['rule_id'] in enabled_map:
                     template_rule['enabled'] = enabled_map[r['rule_id']]
+                elif 'enabled' in r:
+                    template_rule['enabled'] = r['enabled']
+                else:
+                    template_rule['enabled'] = True
                 rulearray.append(template_rule)
 
         path = request.postpath[1:]