mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore] Tidy up some of the search logic (#1082)
* start refactoring some of the search + deref logic * add tests for search api * rename GetRemoteAccount + GetRemoteStatus * make search function a bit simpler + clearer * fix little fucky wucky uwu owo i'm just a little guy * update faulty switch statements * update test to use storage struct * redo switches for clarity * reduce repeated logic in search tests * fastfail getstatus by uri * debug log + trace log better * add implementation note * return early if no result for namestring search * return + check on dereferencing error types * errors hah what errors * remove unneeded error type alias, add custom error text during stringification itself * fix a woops recursion 🙈 Signed-off-by: kim <grufwub@gmail.com> Co-authored-by: kim <grufwub@gmail.com>
This commit is contained in:
@@ -129,7 +129,7 @@ func (p *processor) processCreateStatusFromFederator(ctx context.Context, federa
|
||||
return errors.New("ProcessFromFederator: status was not pinned to federatorMsg, and neither was an IRI for us to dereference")
|
||||
}
|
||||
var err error
|
||||
status, _, err = p.federator.GetRemoteStatus(ctx, federatorMsg.ReceivingAccount.Username, federatorMsg.APIri, false, false)
|
||||
status, _, err = p.federator.GetStatus(ctx, federatorMsg.ReceivingAccount.Username, federatorMsg.APIri, false, false)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -151,7 +151,7 @@ func (p *processor) processCreateStatusFromFederator(ctx context.Context, federa
|
||||
return err
|
||||
}
|
||||
|
||||
a, err := p.federator.GetRemoteAccount(ctx, dereferencing.GetRemoteAccountParams{
|
||||
a, err := p.federator.GetAccount(ctx, dereferencing.GetAccountParams{
|
||||
RequestingUsername: federatorMsg.ReceivingAccount.Username,
|
||||
RemoteAccountID: remoteAccountID,
|
||||
Blocking: true,
|
||||
@@ -197,7 +197,7 @@ func (p *processor) processCreateFaveFromFederator(ctx context.Context, federato
|
||||
return err
|
||||
}
|
||||
|
||||
a, err := p.federator.GetRemoteAccount(ctx, dereferencing.GetRemoteAccountParams{
|
||||
a, err := p.federator.GetAccount(ctx, dereferencing.GetAccountParams{
|
||||
RequestingUsername: federatorMsg.ReceivingAccount.Username,
|
||||
RemoteAccountID: remoteAccountID,
|
||||
Blocking: true,
|
||||
@@ -239,7 +239,7 @@ func (p *processor) processCreateFollowRequestFromFederator(ctx context.Context,
|
||||
return err
|
||||
}
|
||||
|
||||
a, err := p.federator.GetRemoteAccount(ctx, dereferencing.GetRemoteAccountParams{
|
||||
a, err := p.federator.GetAccount(ctx, dereferencing.GetAccountParams{
|
||||
RequestingUsername: federatorMsg.ReceivingAccount.Username,
|
||||
RemoteAccountID: remoteAccountID,
|
||||
Blocking: true,
|
||||
@@ -300,7 +300,7 @@ func (p *processor) processCreateAnnounceFromFederator(ctx context.Context, fede
|
||||
return err
|
||||
}
|
||||
|
||||
a, err := p.federator.GetRemoteAccount(ctx, dereferencing.GetRemoteAccountParams{
|
||||
a, err := p.federator.GetAccount(ctx, dereferencing.GetAccountParams{
|
||||
RequestingUsername: federatorMsg.ReceivingAccount.Username,
|
||||
RemoteAccountID: remoteAccountID,
|
||||
Blocking: true,
|
||||
@@ -370,7 +370,7 @@ func (p *processor) processUpdateAccountFromFederator(ctx context.Context, feder
|
||||
}
|
||||
|
||||
// further database updates occur inside getremoteaccount
|
||||
if _, err := p.federator.GetRemoteAccount(ctx, dereferencing.GetRemoteAccountParams{
|
||||
if _, err := p.federator.GetAccount(ctx, dereferencing.GetAccountParams{
|
||||
RequestingUsername: federatorMsg.ReceivingAccount.Username,
|
||||
RemoteAccountID: incomingAccountURL,
|
||||
RemoteAccountHost: incomingAccount.Domain,
|
||||
|
Reference in New Issue
Block a user