aboutsummaryrefslogtreecommitdiff
path: root/mastodon/accounts.go
diff options
context:
space:
mode:
Diffstat (limited to 'mastodon/accounts.go')
-rw-r--r--mastodon/accounts.go8
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
}