From 91d87b01752a35f67508d5eb6f804946d7f9f7f2 Mon Sep 17 00:00:00 2001 From: r Date: Sun, 19 Apr 2020 05:57:40 +0000 Subject: Add account {hide,show}retweets --- mastodon/accounts.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mastodon') diff --git a/mastodon/accounts.go b/mastodon/accounts.go index 995741c..7a44e2b 100644 --- a/mastodon/accounts.go +++ b/mastodon/accounts.go @@ -199,9 +199,13 @@ type Relationship struct { } // AccountFollow follow the account. -func (c *Client) AccountFollow(ctx context.Context, id string) (*Relationship, error) { +func (c *Client) AccountFollow(ctx context.Context, id string, reblogs *bool) (*Relationship, error) { var relationship Relationship - err := c.doAPI(ctx, http.MethodPost, fmt.Sprintf("/api/v1/accounts/%s/follow", url.PathEscape(string(id))), nil, &relationship, nil) + params := url.Values{} + if reblogs != nil { + params.Set("reblogs", strconv.FormatBool(*reblogs)) + } + err := c.doAPI(ctx, http.MethodPost, fmt.Sprintf("/api/v1/accounts/%s/follow", url.PathEscape(id)), params, &relationship, nil) if err != nil { return nil, err } -- cgit v1.2.3