mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-23 06:41:56 -06: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.
33 lines
580 B
Go
33 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,
|
|
},
|
|
},
|
|
}
|
|
}
|