summary refs log tree commit diff
path: root/synapse/rest
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-02-05 15:11:38 +0000
committerDavid Baker <dave@matrix.org>2015-02-05 15:11:38 +0000
commitaaf50bf6f3d6adee92fa4d5cb55dbf3c5a13dbe3 (patch)
treee75934b0a4650e6698fb66bc3bb6bb238ecffebf /synapse/rest
parentServer default rules now of all kinds rather than all being at lowest prio. (diff)
downloadsynapse-aaf50bf6f3d6adee92fa4d5cb55dbf3c5a13dbe3.tar.xz
Give server default rules the 'default' attribute and fix various brokenness.
Diffstat (limited to 'synapse/rest')
-rw-r--r--synapse/rest/client/v1/push_rule.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/rest/client/v1/push_rule.py b/synapse/rest/client/v1/push_rule.py
index 7ab167ce03..80f116b1ed 100644
--- a/synapse/rest/client/v1/push_rule.py
+++ b/synapse/rest/client/v1/push_rule.py
@@ -345,7 +345,7 @@ def _priority_class_to_template_name(pc):
 def _rule_to_template(rule):
     unscoped_rule_id = None
     if 'rule_id' in rule:
-        _rule_id_from_namespaced(rule['rule_id'])
+        unscoped_rule_id = _rule_id_from_namespaced(rule['rule_id'])
 
     template_name = _priority_class_to_template_name(rule['priority_class'])
     if template_name in ['override', 'underride']:
@@ -364,6 +364,8 @@ def _rule_to_template(rule):
 
     if unscoped_rule_id:
             templaterule['rule_id'] = unscoped_rule_id
+    if 'default' in rule:
+        templaterule['default'] = rule['default']
     return templaterule