mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-06 03:48:45 +00:00
Add account {hide,show}retweets
This commit is contained in:
parent
04af1b93dc
commit
91d87b0175
6 changed files with 34 additions and 11 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue