(ctx context.Context, userID string, ruleSets *pushrules.AccountRuleSets, userAPI userapi.ClientUserAPI)
| 276 | } |
| 277 | |
| 278 | func 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 | |
| 291 | func pushRuleSetByScope(ruleSets *pushrules.AccountRuleSets, scope pushrules.Scope) *pushrules.RuleSet { |
| 292 | switch scope { |
no test coverage detected