Fix to be able to specify multiple id for GetAccountRelationships

pull/24/head
178inaba 2017-04-18 02:45:40 +09:00
parent a7e0c19d35
commit 6f244235d4
1 changed files with 5 additions and 3 deletions

View File

@ -194,12 +194,14 @@ func (c *Client) AccountUnmute(ctx context.Context, id int64) (*Relationship, er
}
// GetAccountRelationship return relationship for the account.
func (c *Client) GetAccountRelationship(ctx context.Context, id int64) ([]*Relationship, error) {
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)
err := c.doAPI(ctx, http.MethodGet, "/api/v1/accounts/relationships", params, &relationships)
if err != nil {
return nil, err
}