diff options
author | 2024-02-06 10:45:46 +0100 | |
---|---|---|
committer | 2024-02-06 09:45:46 +0000 | |
commit | aa396c78d30c129bb2145765d3990571dbc025bb (patch) | |
tree | c2046f00c80b029d4f44a1eaf97ca2e960a492cf /internal/db/bundb/account.go | |
parent | [chore]: Bump github.com/miekg/dns from 1.1.57 to 1.1.58 (#2606) (diff) | |
download | gotosocial-aa396c78d30c129bb2145765d3990571dbc025bb.tar.xz |
[feature] serdes for moved/also_known_as (#2600)
* [feature] serdes for moved/also_known_as
* document `alsoKnownAs` and `movedTo` properties
* only implicitly populate AKA uris from DB for local accounts
* don't let remotes store more than 20 AKA uris to avoid shenanigans
Diffstat (limited to 'internal/db/bundb/account.go')
-rw-r--r-- | internal/db/bundb/account.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/internal/db/bundb/account.go b/internal/db/bundb/account.go index cdb949efa..705e1b118 100644 --- a/internal/db/bundb/account.go +++ b/internal/db/bundb/account.go @@ -279,7 +279,12 @@ func (a *accountDB) PopulateAccount(ctx context.Context, account *gtsmodel.Accou } } - if !account.AlsoKnownAsPopulated() { + // Only try to populate AlsoKnownAs for local accounts, + // since those are the only accounts to which it's relevant. + // + // AKA from remotes might have loads of random-ass values + // set here, and we don't want to do lots of failing DB calls. + if account.IsLocal() && !account.AlsoKnownAsPopulated() { // Account alsoKnownAs accounts are // out-of-date with URIs, repopulate. alsoKnownAs := make([]*gtsmodel.Account, 0) |