summaryrefslogtreecommitdiff
path: root/internal/db/bundb/account.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-03-06 11:18:57 +0100
committerLibravatar GitHub <noreply@github.com>2024-03-06 11:18:57 +0100
commitb22e213e15a7bc64773e626d76305bd860e6301c (patch)
treebdc0f14481b144f8e4e45a380ea3b7cf78490041 /internal/db/bundb/account.go
parent[feature] Filters v1 (#2594) (diff)
downloadgotosocial-b22e213e15a7bc64773e626d76305bd860e6301c.tar.xz
[feature/chore] Add Move database functions + cache (#2647)
* [feature/chore] Add Move database functions + cache * add move mem ratio to envparsing.sh * update comment
Diffstat (limited to 'internal/db/bundb/account.go')
-rw-r--r--internal/db/bundb/account.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/db/bundb/account.go b/internal/db/bundb/account.go
index d2c9c2f51..4d078e68d 100644
--- a/internal/db/bundb/account.go
+++ b/internal/db/bundb/account.go
@@ -304,6 +304,17 @@ func (a *accountDB) PopulateAccount(ctx context.Context, account *gtsmodel.Accou
account.AlsoKnownAs = alsoKnownAs
}
+ if account.Move == nil && account.MoveID != "" {
+ // Account move is not set, fetch from database.
+ account.Move, err = a.state.DB.GetMoveByID(
+ ctx,
+ account.MovedToURI,
+ )
+ if err != nil {
+ errs.Appendf("error populating move: %w", err)
+ }
+ }
+
if account.MovedTo == nil && account.MovedToURI != "" {
// Account movedTo is not set, fetch from database.
account.MovedTo, err = a.state.DB.GetAccountByURI(