From 720344456df706b573c590416e57360759347a60 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Fri, 14 Apr 2017 14:20:22 +0900 Subject: [PATCH] add GetFollowRequests --- mastodon.go | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mastodon.go b/mastodon.go index 72d0408..e7686bb 100644 --- a/mastodon.go +++ b/mastodon.go @@ -345,7 +345,7 @@ func (c *Client) StreamingPublic(ctx context.Context) (chan Event, error) { return q, nil } -// GetAccount return Account. +// Follow send follow-request. func (c *Client) Follow(uri string) (*Account, error) { params := url.Values{} params.Set("uri", uri) @@ -357,3 +357,16 @@ func (c *Client) Follow(uri string) (*Account, error) { } 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 +}