mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
49 lines
1.2 KiB
Python
49 lines
1.2 KiB
Python
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_tweak': 'sound',
|
|
'value': 'default'
|
|
}
|
|
]
|
|
}
|
|
]
|
|
for r in rules:
|
|
r['priority_class'] = 0
|
|
return rules |