From 04f8478aaa02d11ce079d1eaeabcfba88b1fcee7 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 10 Mar 2015 17:26:25 +0000 Subject: Add the master push rule for the break-my-push button. Allow server default rules to be disabled by default. --- synapse/rest/client/v1/push_rule.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'synapse/rest/client') 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:] -- cgit 1.4.1