aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyphen <hyphen@tfwno.gf>2020-08-29 00:27:36 +0200
committerr <r@freesoftwareextremist.com>2020-09-03 04:49:09 +0000
commit71c5da7b3b9e816caa52dbf9e332c5b10112c93d (patch)
tree6a43d68921338f25cef1c7a6dd5e88443df6f365
parenta4a1ce9677e95a5f0503386e972f1f65c6037e2e (diff)
downloadbloat-71c5da7b3b9e816caa52dbf9e332c5b10112c93d.tar.gz
bloat-71c5da7b3b9e816caa52dbf9e332c5b10112c93d.zip
Implement exclusion params for notifications API call
-rw-r--r--mastodon/notification.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/mastodon/notification.go b/mastodon/notification.go
index d793905..5983396 100644
--- a/mastodon/notification.go
+++ b/mastodon/notification.go
@@ -23,9 +23,13 @@ type Notification struct {
}
// GetNotifications return notifications.
-func (c *Client) GetNotifications(ctx context.Context, pg *Pagination) ([]*Notification, error) {
+func (c *Client) GetNotifications(ctx context.Context, pg *Pagination, excludes ...string) ([]*Notification, error) {
var notifications []*Notification
- err := c.doAPI(ctx, http.MethodGet, "/api/v1/notifications", nil, &notifications, pg)
+ params := url.Values{}
+ for _, exclude := range excludes {
+ params.Add("exclude_types[]", exclude)
+ }
+ err := c.doAPI(ctx, http.MethodGet, "/api/v1/notifications", params, &notifications, pg)
if err != nil {
return nil, err
}