diff options
author | 2023-03-01 18:26:53 +0000 | |
---|---|---|
committer | 2023-03-01 18:26:53 +0000 | |
commit | baf933cb9f3e1053bdb61b90d7027efe9fad1bc2 (patch) | |
tree | 3f2a76851d58517ca3dece2bacd6aceefd8dfb96 /internal/processing/account/statuses.go | |
parent | [feature] Federate pinned posts (aka `featuredCollection`) in and out (#1560) (diff) | |
download | gotosocial-baf933cb9f3e1053bdb61b90d7027efe9fad1bc2.tar.xz |
[chore] move client/federator workerpools to Workers{} (#1575)
* replace concurrency worker pools with base models in State.Workers, update code and tests accordingly
* improve code comment
* change back testrig default log level
* un-comment-out TestAnnounceTwice() and fix
---------
Signed-off-by: kim <grufwub@gmail.com>
Reviewed-by: tobi
Diffstat (limited to 'internal/processing/account/statuses.go')
-rw-r--r-- | internal/processing/account/statuses.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/processing/account/statuses.go b/internal/processing/account/statuses.go index 7ff6de2ff..9961dbdbe 100644 --- a/internal/processing/account/statuses.go +++ b/internal/processing/account/statuses.go @@ -33,7 +33,7 @@ import ( // the account given in authed. func (p *Processor) StatusesGet(ctx context.Context, requestingAccount *gtsmodel.Account, targetAccountID string, limit int, excludeReplies bool, excludeReblogs bool, maxID string, minID string, pinned bool, mediaOnly bool, publicOnly bool) (*apimodel.PageableResponse, gtserror.WithCode) { if requestingAccount != nil { - if blocked, err := p.db.IsBlocked(ctx, requestingAccount.ID, targetAccountID, true); err != nil { + if blocked, err := p.state.DB.IsBlocked(ctx, requestingAccount.ID, targetAccountID, true); err != nil { return nil, gtserror.NewErrorInternalError(err) } else if blocked { return nil, gtserror.NewErrorNotFound(fmt.Errorf("block exists between accounts")) @@ -46,10 +46,10 @@ func (p *Processor) StatusesGet(ctx context.Context, requestingAccount *gtsmodel ) if pinned { // Get *ONLY* pinned statuses. - statuses, err = p.db.GetAccountPinnedStatuses(ctx, targetAccountID) + statuses, err = p.state.DB.GetAccountPinnedStatuses(ctx, targetAccountID) } else { // Get account statuses which *may* include pinned ones. - statuses, err = p.db.GetAccountStatuses(ctx, targetAccountID, limit, excludeReplies, excludeReblogs, maxID, minID, mediaOnly, publicOnly) + statuses, err = p.state.DB.GetAccountStatuses(ctx, targetAccountID, limit, excludeReplies, excludeReblogs, maxID, minID, mediaOnly, publicOnly) } if err != nil { if err == db.ErrNoEntries { @@ -120,7 +120,7 @@ func (p *Processor) StatusesGet(ctx context.Context, requestingAccount *gtsmodel // WebStatusesGet fetches a number of statuses (in descending order) from the given account. It selects only // statuses which are suitable for showing on the public web profile of an account. func (p *Processor) WebStatusesGet(ctx context.Context, targetAccountID string, maxID string) (*apimodel.PageableResponse, gtserror.WithCode) { - acct, err := p.db.GetAccountByID(ctx, targetAccountID) + acct, err := p.state.DB.GetAccountByID(ctx, targetAccountID) if err != nil { if err == db.ErrNoEntries { err := fmt.Errorf("account %s not found in the db, not getting web statuses for it", targetAccountID) @@ -134,7 +134,7 @@ func (p *Processor) WebStatusesGet(ctx context.Context, targetAccountID string, return nil, gtserror.NewErrorNotFound(err) } - statuses, err := p.db.GetAccountWebStatuses(ctx, targetAccountID, 10, maxID) + statuses, err := p.state.DB.GetAccountWebStatuses(ctx, targetAccountID, 10, maxID) if err != nil { if err == db.ErrNoEntries { return util.EmptyPageableResponse(), nil |