[chore] Add interaction filter to complement existing visibility filter (#3111)

* [chore] Add interaction filter to complement existing visibility filter

* pass in ptr to visibility and interaction filters to Processor{} to ensure shared

* use int constants for for match type, cache db calls in filterctx

* function name typo 😇

---------

Co-authored-by: kim <grufwub@gmail.com>
This commit is contained in:
tobi
2024-07-24 13:27:42 +02:00
committed by GitHub
parent 63fc9b6c3e
commit c9b6220fef
61 changed files with 1661 additions and 585 deletions

View File

@ -19,6 +19,7 @@ package status
import (
"github.com/superseriousbusiness/gotosocial/internal/federation"
"github.com/superseriousbusiness/gotosocial/internal/filter/interaction"
"github.com/superseriousbusiness/gotosocial/internal/filter/visibility"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/processing/common"
@ -35,7 +36,8 @@ type Processor struct {
state *state.State
federator *federation.Federator
converter *typeutils.Converter
filter *visibility.Filter
visFilter *visibility.Filter
intFilter *interaction.Filter
formatter *text.Formatter
parseMention gtsmodel.ParseMentionFunc
@ -50,7 +52,8 @@ func New(
polls *polls.Processor,
federator *federation.Federator,
converter *typeutils.Converter,
filter *visibility.Filter,
visFilter *visibility.Filter,
intFilter *interaction.Filter,
parseMention gtsmodel.ParseMentionFunc,
) Processor {
return Processor{
@ -58,7 +61,8 @@ func New(
state: state,
federator: federator,
converter: converter,
filter: filter,
visFilter: visFilter,
intFilter: intFilter,
formatter: text.NewFormatter(state.DB),
parseMention: parseMention,
polls: polls,