summary refs log tree commit diff
path: root/synapse/push/baserules.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-01-30 14:17:47 +0000
committerErik Johnston <erik@matrix.org>2015-01-30 14:17:47 +0000
commit84b78c3b5fe3f5e82c3fdf1a2a1c7eed62e1b887 (patch)
tree0475ae5759bd17bc76780a7f376e8a7bd900a430 /synapse/push/baserules.py
parentSplit up replication_layer module into client, server and transaction queue (diff)
parentMerge branch 'new_state_resolution' of github.com:matrix-org/synapse into rej... (diff)
downloadsynapse-84b78c3b5fe3f5e82c3fdf1a2a1c7eed62e1b887.tar.xz
Merge branch 'rejections_storage' of github.com:matrix-org/synapse into replication_split
Diffstat (limited to 'synapse/push/baserules.py')
-rw-r--r--synapse/push/baserules.py35
1 files changed, 35 insertions, 0 deletions
diff --git a/synapse/push/baserules.py b/synapse/push/baserules.py
new file mode 100644
index 0000000000..4caf7beed2
--- /dev/null
+++ b/synapse/push/baserules.py
@@ -0,0 +1,35 @@
+def make_base_rules(user_name):
+    """
+    Nominally we reserve priority class 0 for these rules, although
+    in practice we just append them to the end so we don't actually need it.
+    """
+    return [
+        {
+            'conditions': [
+                {
+                    'kind': 'event_match',
+                    'key': 'content.body',
+                    'pattern': '*%s*' % (user_name,), # Matrix ID match
+                }
+            ],
+            'actions': [
+                'notify',
+                {
+                    'set_sound': 'default'
+                }
+            ]
+        },
+        {
+            'conditions': [
+                {
+                    'kind': 'contains_display_name'
+                }
+            ],
+            'actions': [
+                'notify',
+                {
+                    'set_sound': 'default'
+                }
+            ]
+        },
+    ]
\ No newline at end of file