mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-30 00:23:32 -06:00
fiddle with it! (that's what she said)
This commit is contained in:
parent
39339dc832
commit
1bfc1aa7d1
10 changed files with 218 additions and 199 deletions
|
|
@ -107,9 +107,14 @@ func (p *Processor) Alias(
|
|||
}
|
||||
|
||||
// Ensure we have account dereferenced.
|
||||
//
|
||||
// As this comes from user input, allow checking
|
||||
// by URL to make things easier, not just to an
|
||||
// exact AP URI (which a user might not even know).
|
||||
targetAccount, _, err := p.federator.GetAccountByURI(ctx,
|
||||
account.Username,
|
||||
newAKA.uri,
|
||||
true,
|
||||
)
|
||||
if err != nil {
|
||||
err := fmt.Errorf(
|
||||
|
|
|
|||
|
|
@ -66,10 +66,13 @@ func (p *Processor) Get(ctx context.Context, requestingAccount *gtsmodel.Account
|
|||
|
||||
// Perform a last-minute fetch of target account to
|
||||
// ensure remote account header / avatar is cached.
|
||||
//
|
||||
// Match by URI only.
|
||||
latest, _, err := p.federator.GetAccountByURI(
|
||||
gtscontext.SetFastFail(ctx),
|
||||
requestingAccount.Username,
|
||||
targetAccountURI,
|
||||
false,
|
||||
)
|
||||
if err != nil {
|
||||
log.Errorf(ctx, "error fetching latest target account: %v", err)
|
||||
|
|
|
|||
|
|
@ -119,11 +119,15 @@ func (p *Processor) MoveSelf(
|
|||
unlock := p.state.ProcessingLocks.Lock(lockKey)
|
||||
defer unlock()
|
||||
|
||||
// Ensure we have a valid, up-to-date representation of the target account.
|
||||
// Ensure we have a valid, up-to-date
|
||||
// representation of the target account.
|
||||
//
|
||||
// Match by uri only.
|
||||
targetAcct, targetAcctable, err = p.federator.GetAccountByURI(
|
||||
ctx,
|
||||
originAcct.Username,
|
||||
targetAcctURI,
|
||||
false,
|
||||
)
|
||||
if err != nil {
|
||||
const text = "error dereferencing moved_to_uri"
|
||||
|
|
|
|||
|
|
@ -564,10 +564,15 @@ func (p *Processor) accountsByURI(
|
|||
if resolve {
|
||||
// We're allowed to resolve, leave the
|
||||
// rest up to the dereferencer functions.
|
||||
//
|
||||
// Allow dereferencing by URL and not just URI;
|
||||
// there are many cases where someone might
|
||||
// paste a URL into the search bar.
|
||||
account, _, err := p.federator.GetAccountByURI(
|
||||
gtscontext.SetFastFail(ctx),
|
||||
requestingAccount.Username,
|
||||
uri,
|
||||
true,
|
||||
)
|
||||
|
||||
return []*gtsmodel.Account{account}, err
|
||||
|
|
|
|||
|
|
@ -303,10 +303,13 @@ func (p *fediAPI) MoveAccount(ctx context.Context, fMsg *messages.FromFediAPI) e
|
|||
}
|
||||
|
||||
// Account to which the Move is taking place.
|
||||
//
|
||||
// Match by uri only.
|
||||
targetAcct, targetAcctable, err := p.federate.GetAccountByURI(
|
||||
ctx,
|
||||
fMsg.Receiving.Username,
|
||||
targetAcctURI,
|
||||
false,
|
||||
)
|
||||
if err != nil {
|
||||
return gtserror.Newf(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue