diff options
author | Kegan Dougal <kegan@matrix.org> | 2015-02-02 15:57:59 +0000 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2015-02-02 15:57:59 +0000 |
commit | c059c9fea5e3ef36cadc136e055284953556c4ed (patch) | |
tree | 39faa451578ceecc16c92c390a564ebec4fc2373 /synapse/push/baserules.py | |
parent | Add basic application_services SQL, and hook up parts of the appservice store... (diff) | |
parent | Ignore empty strings for display names & room names in notifications (diff) | |
download | synapse-c059c9fea5e3ef36cadc136e055284953556c4ed.tar.xz |
Merge branch 'develop' into application-services
Conflicts: synapse/handlers/__init__.py synapse/storage/__init__.py
Diffstat (limited to 'synapse/push/baserules.py')
-rw-r--r-- | synapse/push/baserules.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/synapse/push/baserules.py b/synapse/push/baserules.py new file mode 100644 index 0000000000..382de118e0 --- /dev/null +++ b/synapse/push/baserules.py @@ -0,0 +1,48 @@ +def make_base_rules(user_name): + rules = [ + { + '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' + } + ] + }, + { + 'conditions': [ + { + 'kind': 'room_member_count', + 'is': '2' + } + ], + 'actions': [ + 'notify', + { + 'set_sound': 'default' + } + ] + } + ] + for r in rules: + r['priority_class'] = 0 + return rules \ No newline at end of file |