summary refs log tree commit diff
path: root/synapse/push/baserules.py
blob: 4caf7beed2a2792e79327b67e67d98ca27f7463a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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'
                }
            ]
        },
    ]