Skip to content

Commit 9b42fbe

Browse files
committed
Expose notification option for username/MXID
For those unfortunate people that get pinged constantly.
1 parent bb4d8ee commit 9b42fbe

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

‎src/components/views/settings/Notifications.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ module.exports = React.createClass({
458458
'.m.rule.master': 'master',
459459

460460
// The default push rules displayed by Vector UI
461-
// XXX: .m.rule.contains_user_name is not managed (not a fancy rule for Vector?)
462461
'.m.rule.contains_display_name': 'vector',
462+
'.m.rule.contains_user_name': 'vector',
463463
'.m.rule.room_one_to_one': 'vector',
464464
'.m.rule.message': 'vector',
465465
'.m.rule.invite_for_me': 'vector',
@@ -512,6 +512,7 @@ module.exports = React.createClass({
512512

513513
var vectorRuleIds = [
514514
'.m.rule.contains_display_name',
515+
'.m.rule.contains_user_name',
515516
'_keywords',
516517
'.m.rule.room_one_to_one',
517518
'.m.rule.message',

‎src/notifications/VectorPushRulesDefinitions.js‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,20 @@ class VectorPushRuleDefinition {
6363
*/
6464
module.exports = {
6565
// Messages containing user's display name
66-
// (skip contains_user_name which is too geeky)
6766
".m.rule.contains_display_name": new VectorPushRuleDefinition({
6867
kind: "override",
69-
description: "Messages containing my name",
68+
description: "Messages containing my display name",
69+
vectorStateToActions: { // The actions for each vector state, or null to disable the rule.
70+
on: StandardActions.ACTION_NOTIFY,
71+
loud: StandardActions.ACTION_HIGHLIGHT_DEFAULT_SOUND,
72+
off: StandardActions.ACTION_DISABLED
73+
}
74+
}),
75+
76+
// Messages containing user's username (localpart/MXID)
77+
".m.rule.contains_user_name": new VectorPushRuleDefinition({
78+
kind: "override",
79+
description: "Messages containing my username",
7080
vectorStateToActions: { // The actions for each vector state, or null to disable the rule.
7181
on: StandardActions.ACTION_NOTIFY,
7282
loud: StandardActions.ACTION_HIGHLIGHT_DEFAULT_SOUND,

0 commit comments

Comments
 (0)