mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
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
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user