diff options
author | 2023-11-10 17:16:58 +0100 | |
---|---|---|
committer | 2023-11-10 17:16:58 +0100 | |
commit | 7ce3a1e6f3e9da43cd0a28f3018b8526decab698 (patch) | |
tree | 1b7b10513651d13b37ef188a50e3e9f9dc2c2030 /internal/federation/dereferencing/account.go | |
parent | [bugfix/docs] Poll api fixups + swagger docs (#2345) (diff) | |
download | gotosocial-7ce3a1e6f3e9da43cd0a28f3018b8526decab698.tar.xz |
[bugfix] Don't try to update suspended accounts (#2348)
* [bugfix] Don't try to update suspended accounts
* bail early if requesting account suspended
Diffstat (limited to 'internal/federation/dereferencing/account.go')
-rw-r--r-- | internal/federation/dereferencing/account.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/federation/dereferencing/account.go b/internal/federation/dereferencing/account.go index a4e74de3c..562062c8d 100644 --- a/internal/federation/dereferencing/account.go +++ b/internal/federation/dereferencing/account.go @@ -42,6 +42,11 @@ import ( // accountUpToDate returns whether the given account model is both updateable (i.e. // non-instance remote account) and whether it needs an update based on `fetched_at`. func accountUpToDate(account *gtsmodel.Account) bool { + if !account.SuspendedAt.IsZero() { + // Can't update suspended accounts. + return true + } + if account.IsLocal() { // Can't update local accounts. return true @@ -331,6 +336,11 @@ func (d *Dereferencer) enrichAccountSafely( account *gtsmodel.Account, apubAcc ap.Accountable, ) (*gtsmodel.Account, ap.Accountable, error) { + // Noop if account has been suspended. + if !account.SuspendedAt.IsZero() { + return account, nil, nil + } + // By default use account.URI // as the per-URI deref lock. uriStr := account.URI |