diff options
author | Erik Johnston <erik@matrix.org> | 2016-06-08 10:50:31 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-06-08 10:50:31 +0100 |
commit | 5c7311515537832fcc462cc857316d62c36ee54d (patch) | |
tree | 715ef91066fd1c785cab632257063365835c9b58 /synapse/push/clientformat.py | |
parent | Note that v0.15.x was never released (diff) | |
parent | Merge pull request #850 from matrix-org/erikj/gc_threshold (diff) | |
download | synapse-5c7311515537832fcc462cc857316d62c36ee54d.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into release-v0.16.0
Diffstat (limited to 'synapse/push/clientformat.py')
-rw-r--r-- | synapse/push/clientformat.py | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/synapse/push/clientformat.py b/synapse/push/clientformat.py index b3983f7940..e0331b2d2d 100644 --- a/synapse/push/clientformat.py +++ b/synapse/push/clientformat.py @@ -13,37 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from synapse.push.baserules import list_with_base_rules - from synapse.push.rulekinds import ( PRIORITY_CLASS_MAP, PRIORITY_CLASS_INVERSE_MAP ) import copy -import simplejson as json - - -def load_rules_for_user(user, rawrules, enabled_map): - ruleslist = [] - for rawrule in rawrules: - rule = dict(rawrule) - rule["conditions"] = json.loads(rawrule["conditions"]) - rule["actions"] = json.loads(rawrule["actions"]) - ruleslist.append(rule) - - # We're going to be mutating this a lot, so do a deep copy - rules = list(list_with_base_rules(ruleslist)) - - for i, rule in enumerate(rules): - rule_id = rule['rule_id'] - if rule_id in enabled_map: - if rule.get('enabled', True) != bool(enabled_map[rule_id]): - # Rules are cached across users. - rule = dict(rule) - rule['enabled'] = bool(enabled_map[rule_id]) - rules[i] = rule - - return rules def format_push_rules_for_user(user, ruleslist): |