mirror of
https://github.com/matrix-org/dendrite
synced 2024-11-04 23:19:03 +01:00
f47515e38b
This should fix https://github.com/matrix-org/dendrite/issues/2882 (Tested with FluffyChat 1.7.1) Also adds tests that the predefined push rules (as per the spec) is what we have in Dendrite.
32 lines
580 B
Go
32 lines
580 B
Go
package pushrules
|
|
|
|
func defaultContentRules(localpart string) []*Rule {
|
|
return []*Rule{
|
|
mRuleContainsUserNameDefinition(localpart),
|
|
}
|
|
}
|
|
|
|
const (
|
|
MRuleContainsUserName = ".m.rule.contains_user_name"
|
|
)
|
|
|
|
func mRuleContainsUserNameDefinition(localpart string) *Rule {
|
|
return &Rule{
|
|
RuleID: MRuleContainsUserName,
|
|
Default: true,
|
|
Enabled: true,
|
|
Pattern: &localpart,
|
|
Actions: []*Action{
|
|
{Kind: NotifyAction},
|
|
{
|
|
Kind: SetTweakAction,
|
|
Tweak: SoundTweak,
|
|
Value: "default",
|
|
},
|
|
{
|
|
Kind: SetTweakAction,
|
|
Tweak: HighlightTweak,
|
|
},
|
|
},
|
|
}
|
|
}
|