diff options
author | Erik Johnston <erik@matrix.org> | 2015-02-10 11:04:37 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-02-10 11:04:37 +0000 |
commit | c86ebe76736a4cde48cfb3229d894a174c6bd379 (patch) | |
tree | afc236e8ef1bdbd6d0686747b99743661522638e /synapse/push/baserules.py | |
parent | Oops, we do want to defer.return regardless of whether we are caching or not (diff) | |
parent | Merge branch 'release-v0.6.2' of github.com:matrix-org/synapse into develop (diff) | |
download | synapse-c86ebe76736a4cde48cfb3229d894a174c6bd379.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into state-chache
Conflicts: synapse/app/homeserver.py synapse/state.py
Diffstat (limited to 'synapse/push/baserules.py')
-rw-r--r-- | synapse/push/baserules.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/synapse/push/baserules.py b/synapse/push/baserules.py index 8d4b806da6..37878f1e0b 100644 --- a/synapse/push/baserules.py +++ b/synapse/push/baserules.py @@ -4,24 +4,24 @@ def list_with_base_rules(rawrules, user_name): ruleslist = [] # shove the server default rules for each kind onto the end of each - current_prio_class = 1 + current_prio_class = PRIORITY_CLASS_INVERSE_MAP.keys()[-1] for r in rawrules: - if r['priority_class'] > current_prio_class: - while current_prio_class < r['priority_class']: + if r['priority_class'] < current_prio_class: + while r['priority_class'] < current_prio_class: ruleslist.extend(make_base_rules( user_name, PRIORITY_CLASS_INVERSE_MAP[current_prio_class]) ) - current_prio_class += 1 + current_prio_class -= 1 ruleslist.append(r) - while current_prio_class <= PRIORITY_CLASS_INVERSE_MAP.keys()[-1]: + while current_prio_class > 0: ruleslist.extend(make_base_rules( user_name, PRIORITY_CLASS_INVERSE_MAP[current_prio_class]) ) - current_prio_class += 1 + current_prio_class -= 1 return ruleslist |