add GetFollowRequests

pull/5/head
Yasuhiro Matsumoto 2017-04-14 14:20:22 +09:00
parent 34a93da2c3
commit 720344456d
1 changed files with 14 additions and 1 deletions

View File

@ -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
}