summaryrefslogtreecommitdiff
path: root/internal/processing
diff options
context:
space:
mode:
authorLibravatar Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com>2021-08-10 16:56:59 +0200
committerLibravatar GitHub <noreply@github.com>2021-08-10 16:56:59 +0200
commit6acd410426f2f8941a0dbec4bfe07c2a94ce62b7 (patch)
treedbae658794d294c845640b9244b061cbbf11d94f /internal/processing
parentroll back to sha256 for signatures (diff)
downloadgotosocial-6acd410426f2f8941a0dbec4bfe07c2a94ce62b7.tar.xz
Bugfixerino (#133)
* fix some lil bugs * fmt, lint
Diffstat (limited to 'internal/processing')
-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)