mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-01 03:03:10 -06:00
Update defaults
This commit is contained in:
parent
4ce5fece5b
commit
1aa25b38da
|
|
@ -16,7 +16,7 @@ type Action struct {
|
|||
Tweak TweakKey `json:"-"`
|
||||
|
||||
// Value is some value interpreted according to Kind and Tweak.
|
||||
Value interface{} `json:"value,omitempty"`
|
||||
Value interface{} `json:"value"`
|
||||
}
|
||||
|
||||
func (a *Action) MarshalJSON() ([]byte, error) {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ func mRuleContainsUserNameDefinition(localpart string) *Rule {
|
|||
{
|
||||
Kind: SetTweakAction,
|
||||
Tweak: HighlightTweak,
|
||||
Value: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ var (
|
|||
{
|
||||
Kind: SetTweakAction,
|
||||
Tweak: HighlightTweak,
|
||||
Value: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -95,6 +96,7 @@ var (
|
|||
{
|
||||
Kind: SetTweakAction,
|
||||
Tweak: HighlightTweak,
|
||||
Value: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -118,6 +120,7 @@ var (
|
|||
{
|
||||
Kind: SetTweakAction,
|
||||
Tweak: HighlightTweak,
|
||||
Value: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -155,6 +158,7 @@ func mRuleInviteForMeDefinition(userID string) *Rule {
|
|||
{
|
||||
Kind: SetTweakAction,
|
||||
Tweak: HighlightTweak,
|
||||
Value: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,11 @@ var (
|
|||
Tweak: SoundTweak,
|
||||
Value: "ring",
|
||||
},
|
||||
{
|
||||
Kind: SetTweakAction,
|
||||
Tweak: HighlightTweak,
|
||||
Value: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
mRuleEncryptedRoomOneToOneDefinition = Rule{
|
||||
|
|
@ -56,8 +61,8 @@ var (
|
|||
{Kind: NotifyAction},
|
||||
{
|
||||
Kind: SetTweakAction,
|
||||
Tweak: SoundTweak,
|
||||
Value: "default",
|
||||
Tweak: HighlightTweak,
|
||||
Value: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -80,8 +85,8 @@ var (
|
|||
{Kind: NotifyAction},
|
||||
{
|
||||
Kind: SetTweakAction,
|
||||
Tweak: SoundTweak,
|
||||
Value: "default",
|
||||
Tweak: HighlightTweak,
|
||||
Value: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -96,7 +101,7 @@ var (
|
|||
Pattern: "m.room.message",
|
||||
},
|
||||
},
|
||||
Actions: []*Action{{Kind: NotifyAction}},
|
||||
Actions: []*Action{{Kind: DontNotifyAction}},
|
||||
}
|
||||
mRuleEncryptedDefinition = Rule{
|
||||
RuleID: MRuleEncrypted,
|
||||
|
|
@ -109,6 +114,6 @@ var (
|
|||
Pattern: "m.room.encrypted",
|
||||
},
|
||||
},
|
||||
Actions: []*Action{{Kind: NotifyAction}},
|
||||
Actions: []*Action{{Kind: DontNotifyAction}},
|
||||
}
|
||||
)
|
||||
|
|
|
|||
|
|
@ -42,12 +42,12 @@ type Rule struct {
|
|||
|
||||
// Conditions provide the rule's conditions for OverrideKind and
|
||||
// UnderrideKind. Not allowed for other kinds.
|
||||
Conditions []*Condition `json:"conditions,omitempty"`
|
||||
Conditions []*Condition `json:"conditions"`
|
||||
|
||||
// Pattern is the body pattern to match for ContentKind. Required
|
||||
// for that kind. The interpretation is the same as that of
|
||||
// Condition.Pattern.
|
||||
Pattern string `json:"pattern,omitempty"`
|
||||
Pattern string `json:"pattern"`
|
||||
}
|
||||
|
||||
// Scope only has one valid value. See also AccountRuleSets.
|
||||
|
|
|
|||
|
|
@ -749,6 +749,8 @@ func (a *UserInternalAPI) QueryPushRules(ctx context.Context, req *api.QueryPush
|
|||
if err := a.DB.SaveAccountData(ctx, localpart, "", pushRulesAccountDataType, json.RawMessage(prbs)); err != nil {
|
||||
return fmt.Errorf("failed to save default push rules: %w", err)
|
||||
}
|
||||
res.RuleSets = pushRuleSets
|
||||
return nil
|
||||
}
|
||||
var data pushrules.AccountRuleSets
|
||||
if err := json.Unmarshal([]byte(bs), &data); err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue