From e04b187702acb0c9908237a35b3a9857e2167b3f Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 4 Oct 2021 15:24:19 +0200 Subject: Refactor/tidy (#261) * tidy up streaming * cut down code duplication * test get followers/following * test streaming processor * fix some test models * add TimeMustParse * fix uri / url typo * make trace logging less verbose * make logging more consistent * disable quote on logging * remove context.Background * remove many extraneous mastodon references * regenerate swagger * don't log query on no rows result * log latency first for easier reading --- internal/processing/search.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/processing/search.go') diff --git a/internal/processing/search.go b/internal/processing/search.go index 2fb1f6062..c5bfd722b 100644 --- a/internal/processing/search.go +++ b/internal/processing/search.go @@ -93,8 +93,8 @@ func (p *processor) SearchGet(ctx context.Context, authed *oauth.Auth, searchQue // make sure there's no block in either direction between the account and the requester if blocked, err := p.db.IsBlocked(ctx, authed.Account.ID, foundAccount.ID, true); err == nil && !blocked { // all good, convert it and add it to the results - if acctMasto, err := p.tc.AccountToMastoPublic(ctx, foundAccount); err == nil && acctMasto != nil { - results.Accounts = append(results.Accounts, *acctMasto) + if apiAcct, err := p.tc.AccountToAPIAccountPublic(ctx, foundAccount); err == nil && apiAcct != nil { + results.Accounts = append(results.Accounts, *apiAcct) } } } @@ -104,12 +104,12 @@ func (p *processor) SearchGet(ctx context.Context, authed *oauth.Auth, searchQue continue } - statusMasto, err := p.tc.StatusToMasto(ctx, foundStatus, authed.Account) + apiStatus, err := p.tc.StatusToAPIStatus(ctx, foundStatus, authed.Account) if err != nil { continue } - results.Statuses = append(results.Statuses, *statusMasto) + results.Statuses = append(results.Statuses, *apiStatus) } return results, nil -- cgit v1.2.3