add GetFollowRequests
This commit is contained in:
parent
34a93da2c3
commit
720344456d
15
mastodon.go
15
mastodon.go
|
@ -345,7 +345,7 @@ func (c *Client) StreamingPublic(ctx context.Context) (chan Event, error) {
|
||||||
return q, nil
|
return q, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAccount return Account.
|
// Follow send follow-request.
|
||||||
func (c *Client) Follow(uri string) (*Account, error) {
|
func (c *Client) Follow(uri string) (*Account, error) {
|
||||||
params := url.Values{}
|
params := url.Values{}
|
||||||
params.Set("uri", uri)
|
params.Set("uri", uri)
|
||||||
|
@ -357,3 +357,16 @@ func (c *Client) Follow(uri string) (*Account, error) {
|
||||||
}
|
}
|
||||||
return &account, nil
|
return &account, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetFollowRequest return follow-requests.
|
||||||
|
func (c *Client) GetFollowRequests(uri string) ([]*Account, error) {
|
||||||
|
params := url.Values{}
|
||||||
|
params.Set("uri", uri)
|
||||||
|
|
||||||
|
var accounts []*Account
|
||||||
|
err := c.doAPI("GET", "/api/v1/follow_requests", params, &accounts)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return accounts, nil
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user