summary refs log tree commit diff
path: root/synapse/push/baserules.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-03-06 11:50:51 +0000
committerDavid Baker <dave@matrix.org>2015-03-06 11:50:51 +0000
commitc06b45129c218b87867595351e6500d17bc0bd92 (patch)
tree5f1e21e5ac0808a81550487ea7812d9ab5d43f11 /synapse/push/baserules.py
parentComment typo (diff)
downloadsynapse-c06b45129c218b87867595351e6500d17bc0bd92.tar.xz
Add more server default rules so we have default rules for whether you get notifs for invites / random member events
Diffstat (limited to '')
-rw-r--r--synapse/push/baserules.py74
1 files changed, 72 insertions, 2 deletions
diff --git a/synapse/push/baserules.py b/synapse/push/baserules.py
index fcc6633156..eddc7fcbe2 100644
--- a/synapse/push/baserules.py
+++ b/synapse/push/baserules.py
@@ -33,7 +33,7 @@ def make_base_rules(user, kind):
     if kind == 'override':
         rules = make_base_override_rules()
     elif kind == 'underride':
-        rules = make_base_underride_rules()
+        rules = make_base_underride_rules(user)
     elif kind == 'content':
         rules = make_base_content_rules(user)
 
@@ -119,9 +119,79 @@ def make_base_override_rules():
     ]
 
 
-def make_base_underride_rules():
+def make_base_underride_rules(user):
     return [
         {
+            'rule_id': 'global/underride/.m.rule.invite_for_me',
+            'conditions': [
+                {
+                    'kind': 'event_match',
+                    'key': 'type',
+                    'pattern': 'm.room.member',
+                },
+                {
+                    'kind': 'event_match',
+                    'key': 'content.membership',
+                    'pattern': 'invite',
+                },
+                {
+                    'kind': 'event_match',
+                    'key': 'state_key',
+                    'pattern': user.to_string(),
+                },
+            ],
+            'actions': [
+                'notify',
+                {
+                    'set_tweak': 'sound',
+                    'value': 'default'
+                }
+            ]
+        },
+        {
+            'rule_id': 'global/underride/.m.rule.member_event',
+            'conditions': [
+                {
+                    'kind': 'event_match',
+                    'key': 'type',
+                    'pattern': 'm.room.member',
+                }
+            ],
+            'actions': [
+                'notify',
+            ]
+        },
+        {
+            'rule_id': 'global/underride/.m.rule.message',
+            'conditions': [
+                {
+                    'kind': 'event_match',
+                    'key': 'type',
+                    'pattern': 'm.room.message',
+                }
+            ],
+            'actions': [
+                'notify',
+            ]
+        },
+        {
+            'rule_id': 'global/underride/.m.rule.call',
+            'conditions': [
+                {
+                    'kind': 'event_match',
+                    'key': 'type',
+                    'pattern': 'm.call.invite',
+                }
+            ],
+            'actions': [
+                'notify',
+                {
+                    'set_tweak': 'sound',
+                    'value': 'ring'
+                }
+            ]
+        },
+        {
             'rule_id': 'global/underride/.m.rule.fallback',
             'conditions': [
             ],