mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 03:12:24 -05:00
[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
This commit is contained in:
parent
ebdcb00d0a
commit
fd6637df4a
7 changed files with 244 additions and 127 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue