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 11:10:37 +0000
committerErik Johnston <erik@matrix.org>2015-01-30 11:10:37 +0000
commit2ebf795c0ada8b30f22f9aca54753471a04649f6 (patch)
tree23710ca7b15e7d65eee8885a04b23a829ca00379 /synapse/push/baserules.py
parentUpdate the current state of an event if we update auth events. (diff)
parentInclude content in notification pokes (diff)
downloadsynapse-2ebf795c0ada8b30f22f9aca54753471a04649f6.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into rejections
Conflicts:
	synapse/storage/__init__.py
	synapse/storage/schema/delta/v12.sql
Diffstat (limited to '')
-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