mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] update common get target account / status doing refresh async (#3124)
This commit is contained in:
@@ -61,13 +61,22 @@ func (p *Processor) GetTargetAccountBy(
|
||||
}
|
||||
|
||||
if requester != nil && visible {
|
||||
// Ensure the account is up-to-date.
|
||||
p.federator.RefreshAccountAsync(ctx,
|
||||
// Only refresh account if visible to requester,
|
||||
// and there is *authorized* requester to prevent
|
||||
// a possible DOS vector for unauthorized clients.
|
||||
latest, _, err := p.federator.RefreshAccount(ctx,
|
||||
requester.Username,
|
||||
target,
|
||||
nil,
|
||||
nil,
|
||||
)
|
||||
if err != nil {
|
||||
log.Errorf(ctx, "error refreshing target %s: %v", target.URI, err)
|
||||
return target, visible, nil
|
||||
}
|
||||
|
||||
// Set latest.
|
||||
target = latest
|
||||
}
|
||||
|
||||
return target, visible, nil
|
||||
|
Reference in New Issue
Block a user