mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 07:28:27 +00: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,
|
|
},
|
|
},
|
|
}
|
|
}
|