update remote account get/deref logic

This commit is contained in:
tsmethurst
2022-01-24 13:12:17 +01:00
parent 3c1eb155e4
commit 667e7f112c
17 changed files with 244 additions and 160 deletions

View File

@@ -22,6 +22,7 @@ import (
"context"
"errors"
"fmt"
"net/url"
"github.com/sirupsen/logrus"
"github.com/superseriousbusiness/gotosocial/internal/ap"
@@ -232,7 +233,12 @@ func (p *processor) processUpdateAccountFromFederator(ctx context.Context, feder
return errors.New("profile was not parseable as *gtsmodel.Account")
}
if _, err := p.federator.EnrichRemoteAccount(ctx, federatorMsg.ReceivingAccount.Username, incomingAccount); err != nil {
incomingAccountURL, err := url.Parse(incomingAccount.URI)
if err != nil {
return err
}
if _, err := p.federator.GetRemoteAccount(ctx, federatorMsg.ReceivingAccount.Username, incomingAccountURL, false, true); err != nil {
return fmt.Errorf("error enriching updated account from federator: %s", err)
}