diff options
author | 2024-09-09 18:07:25 +0200 | |
---|---|---|
committer | 2024-09-09 18:07:25 +0200 | |
commit | 5543fd53400037dc8ae22d4919b7085c46177ce1 (patch) | |
tree | 9f4b9df4a65165e32888ac038a7c5f6f0724233d /internal/processing/account/statuses.go | |
parent | [chore]: Bump golang.org/x/crypto from 0.26.0 to 0.27.0 (#3283) (diff) | |
download | gotosocial-5543fd53400037dc8ae22d4919b7085c46177ce1.tar.xz |
[feature/frontend] Add options to include Unlisted posts or hide all posts (#3272)
* [feature/frontend] Add options to include Unlisted posts or hide all posts
* finish up
* swagger
* move invalidate call into bundb package, avoid invalidating if not necessary
* rename show_web_statuses => web_visibility
* don't use ptr for webvisibility
* last bits
Diffstat (limited to 'internal/processing/account/statuses.go')
-rw-r--r-- | internal/processing/account/statuses.go | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/internal/processing/account/statuses.go b/internal/processing/account/statuses.go index 2bab812e3..8029a460b 100644 --- a/internal/processing/account/statuses.go +++ b/internal/processing/account/statuses.go @@ -159,7 +159,7 @@ func (p *Processor) WebStatusesGet( return nil, gtserror.NewErrorNotFound(err) } - statuses, err := p.state.DB.GetAccountWebStatuses(ctx, targetAccountID, 10, maxID) + statuses, err := p.state.DB.GetAccountWebStatuses(ctx, account, 10, maxID) if err != nil && !errors.Is(err, db.ErrNoEntries) { return nil, gtserror.NewErrorInternalError(err) } @@ -206,9 +206,15 @@ func (p *Processor) WebStatusesGetPinned( webStatuses := make([]*apimodel.WebStatus, 0, len(statuses)) for _, status := range statuses { - if status.Visibility != gtsmodel.VisibilityPublic { - // Skip non-public - // pinned status. + // Ensure visible via the web. + visible, err := p.visFilter.StatusVisible(ctx, nil, status) + if err != nil { + log.Errorf(ctx, "error checking status visibility: %v", err) + continue + } + + if !visible { + // Don't serve. continue } |