mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-08 18:16:59 +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.
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,
|
|
},
|
|
},
|
|
}
|
|
}
|