summaryrefslogtreecommitdiff
path: root/internal/db/account.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-06-10 18:42:41 +0000
committerLibravatar GitHub <noreply@github.com>2024-06-10 19:42:41 +0100
commitfd6637df4aeed721442bff6dfbce9bdd1b5ac7b8 (patch)
tree8d4ddffdd8742b3cd7aa0be5e26ea235e76b127d /internal/db/account.go
parent[chore] Roll back use of `(created)` pseudo-header pending #2991 (#2992) (diff)
downloadgotosocial-fd6637df4aeed721442bff6dfbce9bdd1b5ac7b8.tar.xz
[bugfix] boost and account recursion (#2982)
* fix possible infinite recursion if moved accounts are self-referential * adds a defensive check for a boost being a boost of a boost wrapper * add checks on input for a boost of a boost * remove unnecessary check * add protections on account move to prevent move recursion loops * separate status conversion without boost logic into separate function to remove risk of recursion * move boost check to boost function itself * formatting * use error 422 instead of 500 * use gtserror not standard errors package for error creation
Diffstat (limited to 'internal/db/account.go')
-rw-r--r--internal/db/account.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal/db/account.go b/internal/db/account.go
index dec36d2ac..4f02a4d29 100644
--- a/internal/db/account.go
+++ b/internal/db/account.go
@@ -57,6 +57,9 @@ type Account interface {
// GetAccountByFollowersURI returns one account with the given followers_uri, or an error if something goes wrong.
GetAccountByFollowersURI(ctx context.Context, uri string) (*gtsmodel.Account, error)
+ // GetAccountByMovedToURI returns any accounts with given moved_to_uri set.
+ GetAccountsByMovedToURI(ctx context.Context, uri string) ([]*gtsmodel.Account, error)
+
// GetAccounts returns accounts
// with the given parameters.
GetAccounts(