mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:56:06 -04:00
Add default push rules including setting a sound for messages mentioning your username / display name
This commit is contained in:
parent
4bdfce30d7
commit
1235f7f383
2 changed files with 74 additions and 8 deletions
35
synapse/push/baserules.py
Normal file
35
synapse/push/baserules.py
Normal file
|
@ -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'
|
||||
}
|
||||
]
|
||||
},
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue