diff options
author | 2021-10-04 15:24:19 +0200 | |
---|---|---|
committer | 2021-10-04 15:24:19 +0200 | |
commit | e04b187702acb0c9908237a35b3a9857e2167b3f (patch) | |
tree | 29839b8d5bbc28d34aba759a48dd7b005f1444f5 /internal/processing/search.go | |
parent | Follow request auto approval (#259) (diff) | |
download | gotosocial-e04b187702acb0c9908237a35b3a9857e2167b3f.tar.xz |
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
Diffstat (limited to 'internal/processing/search.go')
-rw-r--r-- | internal/processing/search.go | 8 |
1 files changed, 4 insertions, 4 deletions
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 |