MCPcopy Create free account
hub / github.com/daodst/chat / putPushRules

Function putPushRules

clientapi/routing/pushrules.go:278–289  ·  view source on GitHub ↗
(ctx context.Context, userID string, ruleSets *pushrules.AccountRuleSets, userAPI userapi.ClientUserAPI)

Source from the content-addressed store, hash-verified

276}
277
278func putPushRules(ctx context.Context, userID string, ruleSets *pushrules.AccountRuleSets, userAPI userapi.ClientUserAPI) error {
279 req := userapi.PerformPushRulesPutRequest{
280 UserID: userID,
281 RuleSets: ruleSets,
282 }
283 var res struct{}
284 if err := userAPI.PerformPushRulesPut(ctx, &req, &res); err != nil {
285 util.GetLogger(ctx).WithError(err).Error("userAPI.PerformPushRulesPut failed")
286 return err
287 }
288 return nil
289}
290
291func pushRuleSetByScope(ruleSets *pushrules.AccountRuleSets, scope pushrules.Scope) *pushrules.RuleSet {
292 switch scope {

Callers 3

PutPushRuleByRuleIDFunction · 0.85
DeletePushRuleByRuleIDFunction · 0.85
PutPushRuleAttrByRuleIDFunction · 0.85

Calls 2

PerformPushRulesPutMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected