summaryrefslogtreecommitdiff
path: root/internal/processing/account/get.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/processing/account/get.go')
-rw-r--r--internal/processing/account/get.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/internal/processing/account/get.go b/internal/processing/account/get.go
index d2994e246..a70bf02bd 100644
--- a/internal/processing/account/get.go
+++ b/internal/processing/account/get.go
@@ -48,7 +48,21 @@ func (p *processor) Get(requestingAccount *gtsmodel.Account, targetAccountID str
var mastoAccount *apimodel.Account
if blocked {
mastoAccount, err = p.tc.AccountToMastoBlocked(targetAccount)
- } else if requestingAccount != nil && targetAccount.ID == requestingAccount.ID {
+ if err != nil {
+ return nil, fmt.Errorf("error converting account: %s", err)
+ }
+ return mastoAccount, nil
+ }
+
+ // last-minute check to make sure we have remote account header/avi cached
+ if targetAccount.Domain != "" {
+ a, err := p.federator.EnrichRemoteAccount(requestingAccount.Username, targetAccount)
+ if err == nil {
+ targetAccount = a
+ }
+ }
+
+ if requestingAccount != nil && targetAccount.ID == requestingAccount.ID {
mastoAccount, err = p.tc.AccountToMastoSensitive(targetAccount)
} else {
mastoAccount, err = p.tc.AccountToMastoPublic(targetAccount)