Support for channel notifications

Add condition type to check the sender's power level and add a base
rule using it for @channel notifications.
This commit is contained in:
David Baker 2017-10-05 12:39:18 +01:00
parent 44f8e383f3
commit fa969cfdde
3 changed files with 59 additions and 8 deletions

View file

@ -1,4 +1,5 @@
# Copyright 2015, 2016 OpenMarket Ltd
# Copyright 2017 New Vector Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -238,6 +239,28 @@ BASE_APPEND_OVERRIDE_RULES = [
}
]
},
{
'rule_id': 'global/underride/.m.rule.channelnotif',
'conditions': [
{
'kind': 'event_match',
'key': 'content.body',
'pattern': '*@channel*',
'_id': '_channelnotif_content',
},
{
'kind': 'sender_power_level',
'is': '>=50',
'_id': '_channelnotif_pl',
},
],
'actions': [
'notify', {
'set_tweak': 'highlight',
'value': True,
}
]
}
]