fix: actually skip pinned

This commit is contained in:
decentral1se 2024-08-10 14:21:13 +02:00
parent 9383cce16d
commit c3bdebdda1
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410

View File

@ -186,6 +186,11 @@ var deleteCmd = &cobra.Command{
continue
}
if status.Pinned && skipPinned {
slog.Info(fmt.Sprintf("skipping %s (skip pinned: %v)", status.ID, skipPinned))
continue
}
numHours := time.Duration(168 * weeks)
if t.Before(time.Now().Add(-time.Hour * numHours)) {
if !dry {
@ -284,11 +289,6 @@ func readAllPaged(authClient *auth.Client, accID string) ([]*models.Status, erro
}
params := &accounts.AccountStatusesParams{ID: accID, MaxID: maxID}
if skipPinned {
includePins := false
params.Pinned = &includePins
}
resp, err := authClient.Client.Accounts.AccountStatuses(params, authClient.Auth)
if err != nil {
slog.Error("error fetching page", "error", err)