From c390a0c32720f6afe852bc7a3a3f64c3afe9e401 Mon Sep 17 00:00:00 2001 From: r Date: Fri, 11 Feb 2022 11:18:02 +0000 Subject: Add lists --- mastodon/lists.go | 4 ++-- mastodon/status.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'mastodon') diff --git a/mastodon/lists.go b/mastodon/lists.go index d323b79..1b76bdc 100644 --- a/mastodon/lists.go +++ b/mastodon/lists.go @@ -90,7 +90,7 @@ func (c *Client) DeleteList(ctx context.Context, id string) error { func (c *Client) AddToList(ctx context.Context, list string, accounts ...string) error { params := url.Values{} for _, acct := range accounts { - params.Add("account_ids", string(acct)) + params.Add("account_ids[]", string(acct)) } return c.doAPI(ctx, http.MethodPost, fmt.Sprintf("/api/v1/lists/%s/accounts", url.PathEscape(string(list))), params, nil, nil) @@ -100,7 +100,7 @@ func (c *Client) AddToList(ctx context.Context, list string, accounts ...string) func (c *Client) RemoveFromList(ctx context.Context, list string, accounts ...string) error { params := url.Values{} for _, acct := range accounts { - params.Add("account_ids", string(acct)) + params.Add("account_ids[]", string(acct)) } return c.doAPI(ctx, http.MethodDelete, fmt.Sprintf("/api/v1/lists/%s/accounts", url.PathEscape(string(list))), params, nil, nil) diff --git a/mastodon/status.go b/mastodon/status.go index 8b148b3..2fae6ee 100644 --- a/mastodon/status.go +++ b/mastodon/status.go @@ -301,7 +301,7 @@ func (c *Client) DeleteStatus(ctx context.Context, id string) error { } // Search search content with query. -func (c *Client) Search(ctx context.Context, q string, qType string, limit int, resolve bool, offset int, accountID string) (*Results, error) { +func (c *Client) Search(ctx context.Context, q string, qType string, limit int, resolve bool, offset int, accountID string, following bool) (*Results, error) { var results Results params := url.Values{} params.Set("q", q) @@ -309,6 +309,7 @@ func (c *Client) Search(ctx context.Context, q string, qType string, limit int, params.Set("limit", fmt.Sprint(limit)) params.Set("resolve", fmt.Sprint(resolve)) params.Set("offset", fmt.Sprint(offset)) + params.Set("following", fmt.Sprint(following)) if len(accountID) > 0 { params.Set("account_id", accountID) } -- cgit v1.2.3