summary refs log tree commit diff
path: root/synapse/push/baserules.py
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2015-02-09 15:20:56 +0000
committerKegan Dougal <kegan@matrix.org>2015-02-09 15:20:56 +0000
commit53557fc53259631d71055ef2ab8a6916b00d229b (patch)
tree208db19fb5bbcc5416e669bc496adc49acdcb1a7 /synapse/push/baserules.py
parentFix bugs so lazy room joining works as intended. (diff)
parentMerge pull request #55 from matrix-org/profiling (diff)
downloadsynapse-53557fc53259631d71055ef2ab8a6916b00d229b.tar.xz
Merge branch 'develop' into application-services
Diffstat (limited to 'synapse/push/baserules.py')
-rw-r--r--synapse/push/baserules.py12
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