2015-01-29 11:38:22 -07:00
|
|
|
def make_base_rules(user_name):
|
2015-01-30 08:54:29 -07:00
|
|
|
rules = [
|
2015-01-29 11:38:22 -07:00
|
|
|
{
|
|
|
|
'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'
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2015-01-30 07:46:03 -07:00
|
|
|
{
|
|
|
|
'conditions': [
|
|
|
|
{
|
|
|
|
'kind': 'room_member_count',
|
|
|
|
'is': '2'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
'actions': [
|
|
|
|
'notify',
|
|
|
|
{
|
2015-02-03 09:06:31 -07:00
|
|
|
'set_tweak': 'sound',
|
|
|
|
'value': 'default'
|
2015-01-30 07:46:03 -07:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2015-01-30 08:54:29 -07:00
|
|
|
]
|
|
|
|
for r in rules:
|
|
|
|
r['priority_class'] = 0
|
|
|
|
return rules
|