Add method to include accounts resolve param

This commit is contained in:
Paul Tyng 2022-11-07 10:27:08 -05:00
parent 7dfe81e233
commit f61059815d
2 changed files with 49 additions and 0 deletions

View file

@ -284,6 +284,20 @@ func (c *Client) AccountsSearch(ctx context.Context, q string, limit int64) ([]*
return accounts, nil
}
func (c *Client) AccountsSearchResolve(ctx context.Context, q string, limit int64) ([]*Account, error) {
params := url.Values{}
params.Set("q", q)
params.Set("limit", fmt.Sprint(limit))
params.Set("resolve", "true")
var accounts []*Account
err := c.doAPI(ctx, http.MethodGet, "/api/v1/accounts/search", params, &accounts, nil)
if err != nil {
return nil, err
}
return accounts, nil
}
// FollowRemoteUser send follow-request.
func (c *Client) FollowRemoteUser(ctx context.Context, uri string) (*Account, error) {
params := url.Values{}