mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-28 16:08:27 +00:00
34 lines
596 B
Go
34 lines
596 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,
|
||
|
Value: true,
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
}
|