diff options
author | David Baker <dave@matrix.org> | 2017-10-05 12:39:18 +0100 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2017-10-05 12:39:18 +0100 |
commit | fa969cfdde72a2d136eba08eb99e00d47ddb5cdf (patch) | |
tree | 31aa55862cb91c4a58045a815e498f9317e85c99 /synapse/push/baserules.py | |
parent | Merge pull request #2500 from matrix-org/dbkr/fix_word_boundary_mentions (diff) | |
download | synapse-fa969cfdde72a2d136eba08eb99e00d47ddb5cdf.tar.xz |
Support for channel notifications
Add condition type to check the sender's power level and add a base rule using it for @channel notifications.
Diffstat (limited to 'synapse/push/baserules.py')
-rw-r--r-- | synapse/push/baserules.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/synapse/push/baserules.py b/synapse/push/baserules.py index 85effdfa46..354b1f4493 100644 --- a/synapse/push/baserules.py +++ b/synapse/push/baserules.py @@ -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, + } + ] + } ] |