Merge branch 'master' of github.com:mattn/go-mastodon

This commit is contained in:
Yasuhiro Matsumoto 2017-04-18 17:18:17 +09:00
commit 20174d5b4a
7 changed files with 485 additions and 93 deletions

View file

@ -206,13 +206,15 @@ func (c *Client) AccountUnmute(ctx context.Context, id int64) (*Relationship, er
return &relationship, nil
}
// GetAccountRelationship return relationship for the account.
func (c *Client) GetAccountRelationship(ctx context.Context, id int64) ([]*Relationship, error) {
// GetAccountRelationships return relationship for the account.
func (c *Client) GetAccountRelationships(ctx context.Context, ids []int64) ([]*Relationship, error) {
params := url.Values{}
params.Set("id", fmt.Sprint(id))
for _, id := range ids {
params.Add("id[]", fmt.Sprint(id))
}
var relationships []*Relationship
err := c.doAPI(ctx, http.MethodGet, "/api/v1/accounts/relationship", params, &relationships, nil)
err := c.doAPI(ctx, http.MethodGet, "/api/v1/accounts/relationships", params, &relationships, nil)
if err != nil {
return nil, err
}