mirror of
https://git.phreedom.club/localhost_frssoft/bloat.git
synced 2024-11-25 13:21:28 +00:00
Fast loading account on Pleroma instances; relationships include in account
This commit is contained in:
parent
d139cb752c
commit
fe304f60e9
|
@ -58,7 +58,11 @@ type AccountSource struct {
|
||||||
// GetAccount return Account.
|
// GetAccount return Account.
|
||||||
func (c *Client) GetAccount(ctx context.Context, id string) (*Account, error) {
|
func (c *Client) GetAccount(ctx context.Context, id string) (*Account, error) {
|
||||||
var account Account
|
var account Account
|
||||||
err := c.doAPI(ctx, http.MethodGet, fmt.Sprintf("/api/v1/accounts/%s", url.PathEscape(string(id))), nil, &account, nil)
|
params := url.Values{}
|
||||||
|
if account.Pleroma != nil {
|
||||||
|
params.Set("with_relationships", "1")
|
||||||
|
}
|
||||||
|
err := c.doAPI(ctx, http.MethodGet, fmt.Sprintf("/api/v1/accounts/%s", url.PathEscape(string(id))), params, &account, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue