diff options
author | 2023-02-09 09:27:07 +0100 | |
---|---|---|
committer | 2023-02-09 09:27:07 +0100 | |
commit | 95715f9251da56bfb7a8c7c48ca5bf38d2392f03 (patch) | |
tree | 80d173e530865fedb9d2cef96814d11f9df9539f /internal/federation/dereferencing/finger.go | |
parent | [chore] Fix report username wrapping (#1464) (diff) | |
download | gotosocial-95715f9251da56bfb7a8c7c48ca5bf38d2392f03.tar.xz |
[performance] Don't fetch avatar + header if uri hasn't changed (#1463)
Diffstat (limited to 'internal/federation/dereferencing/finger.go')
-rw-r--r-- | internal/federation/dereferencing/finger.go | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/internal/federation/dereferencing/finger.go b/internal/federation/dereferencing/finger.go index 03eecf1bb..6950157f1 100644 --- a/internal/federation/dereferencing/finger.go +++ b/internal/federation/dereferencing/finger.go @@ -27,17 +27,12 @@ import ( "strings" apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model" + "github.com/superseriousbusiness/gotosocial/internal/transport" "github.com/superseriousbusiness/gotosocial/internal/util" ) -func (d *deref) fingerRemoteAccount(ctx context.Context, username string, targetUsername string, targetHost string) (accountDomain string, accountURI *url.URL, err error) { - t, err := d.transportController.NewTransportForUsername(ctx, username) - if err != nil { - err = fmt.Errorf("fingerRemoteAccount: error getting transport for %s: %s", username, err) - return - } - - b, err := t.Finger(ctx, targetUsername, targetHost) +func (d *deref) fingerRemoteAccount(ctx context.Context, transport transport.Transport, targetUsername string, targetHost string) (accountDomain string, accountURI *url.URL, err error) { + b, err := transport.Finger(ctx, targetUsername, targetHost) if err != nil { err = fmt.Errorf("fingerRemoteAccount: error fingering @%s@%s: %s", targetUsername, targetHost, err) return |