mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2024-12-22 11:23:33 +02:00
Fast loading account on Pleroma instances; relationships include in account
This commit is contained in:
parent
d139cb752c
commit
fe304f60e9
1 changed files with 5 additions and 1 deletions
|
@ -58,7 +58,11 @@ type AccountSource struct {
|
|||
// GetAccount return Account.
|
||||
func (c *Client) GetAccount(ctx context.Context, id string) (*Account, error) {
|
||||
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 {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue