diff options
author | r <r@freesoftwareextremist.com> | 2020-04-19 05:57:40 +0000 |
---|---|---|
committer | r <r@freesoftwareextremist.com> | 2020-04-19 05:57:40 +0000 |
commit | 91d87b01752a35f67508d5eb6f804946d7f9f7f2 (patch) | |
tree | 65cfc14c69d4ae3b554b600457c39293bf1a79c3 /mastodon | |
parent | 04af1b93dc95d761b4e05a448c9d86ac67623ff6 (diff) | |
download | bloat-91d87b01752a35f67508d5eb6f804946d7f9f7f2.tar.gz bloat-91d87b01752a35f67508d5eb6f804946d7f9f7f2.zip |
Add account {hide,show}retweets
Diffstat (limited to 'mastodon')
-rw-r--r-- | mastodon/accounts.go | 8 |
1 files changed, 6 insertions, 2 deletions
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 } |