diff options
| author | 2021-10-24 11:57:39 +0200 | |
|---|---|---|
| committer | 2021-10-24 11:57:39 +0200 | |
| commit | 4b1d9d3780134098ff06877abc20c970c32d4aac (patch) | |
| tree | a46deccd4cdf2ddf9d0ea92f32bd8669657a4687 /internal/visibility/statusvisible.go | |
| parent | pregenerate RSA keys for testrig accounts. If a user is added without a key,... (diff) | |
| download | gotosocial-4b1d9d3780134098ff06877abc20c970c32d4aac.tar.xz | |
Serve `outbox` for Actor (#289)
* add statusesvisible convenience function
* add minID + onlyPublic to account statuses get
* move swagger collection stuff to common
* start working on Outbox GETting
* move functions into federationProcessor
* outboxToASCollection
* add statusesvisible convenience function
* add minID + onlyPublic to account statuses get
* move swagger collection stuff to common
* start working on Outbox GETting
* move functions into federationProcessor
* outboxToASCollection
* bit more work on outbox paging
* wrapNoteInCreate function
* test + hook up the processor functions
* don't do prev + next links on empty reply
* test get outbox through api
* don't fail on no status entries
* add outbox implementation doc
* typo
Diffstat (limited to 'internal/visibility/statusvisible.go')
| -rw-r--r-- | internal/visibility/statusvisible.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/visibility/statusvisible.go b/internal/visibility/statusvisible.go index 1e48abcda..a99494836 100644 --- a/internal/visibility/statusvisible.go +++ b/internal/visibility/statusvisible.go @@ -239,3 +239,17 @@ func (f *filter) StatusVisible(ctx context.Context, targetStatus *gtsmodel.Statu // If we reached here, all is okay return true, nil } + +func (f *filter) StatusesVisible(ctx context.Context, statuses []*gtsmodel.Status, requestingAccount *gtsmodel.Account) ([]*gtsmodel.Status, error) { + filtered := []*gtsmodel.Status{} + for _, s := range statuses { + visible, err := f.StatusVisible(ctx, s, requestingAccount) + if err != nil { + return nil, err + } + if visible { + filtered = append(filtered, s) + } + } + return filtered, nil +} |
