mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-03 02:22:25 -06:00
ensure we filter home timeline statuses on local only
This commit is contained in:
parent
7cd2269cde
commit
c92bb83298
5 changed files with 46 additions and 14 deletions
|
|
@ -71,6 +71,7 @@ func (p *Processor) getStatusTimeline(
|
|||
filterCtx statusfilter.FilterContext,
|
||||
loadPage func(*paging.Page) (statuses []*gtsmodel.Status, err error),
|
||||
filter func(*gtsmodel.Status) (delete bool),
|
||||
postFilter func(*gtsmodel.Status) (remove bool),
|
||||
) (
|
||||
*apimodel.PageableResponse,
|
||||
gtserror.WithCode,
|
||||
|
|
@ -133,6 +134,15 @@ func (p *Processor) getStatusTimeline(
|
|||
|
||||
// Frontend API model preparation function.
|
||||
func(status *gtsmodel.Status) (*apimodel.Status, error) {
|
||||
|
||||
// Check if status needs filtering OUTSIDE of caching stage.
|
||||
// TODO: this will be moved to separate postFilter hook when
|
||||
// all filtering has been removed from the type converter.
|
||||
if postFilter != nil && postFilter(status) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// Finally, pass status to get converted to API model.
|
||||
apiStatus, err := p.converter.StatusToAPIStatus(ctx,
|
||||
status,
|
||||
requester,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue