Expose notification option for username/MXID

For those unfortunate people that get pinged constantly.
This commit is contained in:
turt2live 2017-02-27 15:32:58 -07:00
parent bb4d8ee3e8
commit 9b42fbe42f
2 changed files with 14 additions and 3 deletions

View File

@ -458,8 +458,8 @@ module.exports = React.createClass({
'.m.rule.master': 'master', '.m.rule.master': 'master',
// The default push rules displayed by Vector UI // The default push rules displayed by Vector UI
// XXX: .m.rule.contains_user_name is not managed (not a fancy rule for Vector?)
'.m.rule.contains_display_name': 'vector', '.m.rule.contains_display_name': 'vector',
'.m.rule.contains_user_name': 'vector',
'.m.rule.room_one_to_one': 'vector', '.m.rule.room_one_to_one': 'vector',
'.m.rule.message': 'vector', '.m.rule.message': 'vector',
'.m.rule.invite_for_me': 'vector', '.m.rule.invite_for_me': 'vector',
@ -512,6 +512,7 @@ module.exports = React.createClass({
var vectorRuleIds = [ var vectorRuleIds = [
'.m.rule.contains_display_name', '.m.rule.contains_display_name',
'.m.rule.contains_user_name',
'_keywords', '_keywords',
'.m.rule.room_one_to_one', '.m.rule.room_one_to_one',
'.m.rule.message', '.m.rule.message',

View File

@ -63,10 +63,20 @@ class VectorPushRuleDefinition {
*/ */
module.exports = { module.exports = {
// Messages containing user's display name // Messages containing user's display name
// (skip contains_user_name which is too geeky)
".m.rule.contains_display_name": new VectorPushRuleDefinition({ ".m.rule.contains_display_name": new VectorPushRuleDefinition({
kind: "override", kind: "override",
description: "Messages containing my name", description: "Messages containing my display name",
vectorStateToActions: { // The actions for each vector state, or null to disable the rule.
on: StandardActions.ACTION_NOTIFY,
loud: StandardActions.ACTION_HIGHLIGHT_DEFAULT_SOUND,
off: StandardActions.ACTION_DISABLED
}
}),
// Messages containing user's username (localpart/MXID)
".m.rule.contains_user_name": new VectorPushRuleDefinition({
kind: "override",
description: "Messages containing my username",
vectorStateToActions: { // The actions for each vector state, or null to disable the rule. vectorStateToActions: { // The actions for each vector state, or null to disable the rule.
on: StandardActions.ACTION_NOTIFY, on: StandardActions.ACTION_NOTIFY,
loud: StandardActions.ACTION_HIGHLIGHT_DEFAULT_SOUND, loud: StandardActions.ACTION_HIGHLIGHT_DEFAULT_SOUND,