diff options
author | 2024-06-17 12:50:50 -0700 | |
---|---|---|
committer | 2024-06-17 20:50:50 +0100 | |
commit | b08c1bd0cbf6986e59247deefbabb150db83aadd (patch) | |
tree | 45d47345c2cf46ddf50533be16470edd17a1da2a /internal/processing/timeline/notification.go | |
parent | [chore]: Bump github.com/spf13/cobra from 1.8.0 to 1.8.1 (#3016) (diff) | |
download | gotosocial-b08c1bd0cbf6986e59247deefbabb150db83aadd.tar.xz |
[feature] Implement types[] param for notifications (#3009)
Counterpart of exclude_types[].
Also updates Swagger spec for types[] to use the correct param name and enumerate possible values.
Fixes #3003
Diffstat (limited to 'internal/processing/timeline/notification.go')
-rw-r--r-- | internal/processing/timeline/notification.go | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/internal/processing/timeline/notification.go b/internal/processing/timeline/notification.go index 5156a1cdf..697649444 100644 --- a/internal/processing/timeline/notification.go +++ b/internal/processing/timeline/notification.go @@ -34,8 +34,26 @@ import ( "github.com/superseriousbusiness/gotosocial/internal/util" ) -func (p *Processor) NotificationsGet(ctx context.Context, authed *oauth.Auth, maxID string, sinceID string, minID string, limit int, excludeTypes []string) (*apimodel.PageableResponse, gtserror.WithCode) { - notifs, err := p.state.DB.GetAccountNotifications(ctx, authed.Account.ID, maxID, sinceID, minID, limit, excludeTypes) +func (p *Processor) NotificationsGet( + ctx context.Context, + authed *oauth.Auth, + maxID string, + sinceID string, + minID string, + limit int, + includeTypes []string, + excludeTypes []string, +) (*apimodel.PageableResponse, gtserror.WithCode) { + notifs, err := p.state.DB.GetAccountNotifications( + ctx, + authed.Account.ID, + maxID, + sinceID, + minID, + limit, + includeTypes, + excludeTypes, + ) if err != nil && !errors.Is(err, db.ErrNoEntries) { err = fmt.Errorf("NotificationsGet: db error getting notifications: %w", err) return nil, gtserror.NewErrorInternalError(err) |