account.GetStatuses: ExcludeBoosts option

This commit is contained in:
gutmet 2022-11-23 20:51:56 +01:00
parent 9585b1ce2e
commit 1cc330baf3

View File

@ -141,9 +141,15 @@ func UpdateCurrentAccount(profile *Profile) (*Account, error) {
return &account, nil return &account, nil
} }
func (a *Account) GetStatuses(pg *Pagination) ([]*Status, error) { func (a *Account) GetStatuses(excludeBoosts bool, pg *Pagination) ([]*Status, error) {
var statuses []*Status var statuses []*Status
err := doAPI(http.MethodGet, fmt.Sprintf("/api/v1/accounts/%s/statuses", url.PathEscape(a.GetID())), nil, &statuses, pg) var params url.Values
params = nil
if excludeBoosts {
params = url.Values{}
params.Set("exclude_reblogs", "true")
}
err := doAPI(http.MethodGet, fmt.Sprintf("/api/v1/accounts/%s/statuses", url.PathEscape(a.GetID())), params, &statuses, pg)
if err != nil { if err != nil {
return nil, err return nil, err
} }