From 45f4afe60e29e147e3adfaa4d7b66ca58e22b1de Mon Sep 17 00:00:00 2001 From: Vyr Cossont Date: Mon, 6 May 2024 04:49:08 -0700 Subject: feature: filters v2 server-side warning/hiding (#2793) * Remove dead code * Filter statuses when converting to frontend representation * status.filtered is an array * Make matching case-insensitive * Remove TODOs that don't need to be done now * Add missing filter check for notification * lint: rename ErrHideStatus * APIFilterActionToFilterAction not used yet * swaggerino docseroni * Address review comments * Add apimodel.FilterActionNone --------- Co-authored-by: tobi <31960611+tsmethurst@users.noreply.github.com> Co-authored-by: tobi --- internal/typeutils/converter_test.go | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'internal/typeutils/converter_test.go') diff --git a/internal/typeutils/converter_test.go b/internal/typeutils/converter_test.go index 716a39c29..fc873a94b 100644 --- a/internal/typeutils/converter_test.go +++ b/internal/typeutils/converter_test.go @@ -473,16 +473,19 @@ const ( type TypeUtilsTestSuite struct { suite.Suite - db db.DB - state state.State - testAccounts map[string]*gtsmodel.Account - testStatuses map[string]*gtsmodel.Status - testAttachments map[string]*gtsmodel.MediaAttachment - testPeople map[string]vocab.ActivityStreamsPerson - testEmojis map[string]*gtsmodel.Emoji - testReports map[string]*gtsmodel.Report - testMentions map[string]*gtsmodel.Mention - testPollVotes map[string]*gtsmodel.PollVote + db db.DB + state state.State + testAccounts map[string]*gtsmodel.Account + testStatuses map[string]*gtsmodel.Status + testAttachments map[string]*gtsmodel.MediaAttachment + testPeople map[string]vocab.ActivityStreamsPerson + testEmojis map[string]*gtsmodel.Emoji + testReports map[string]*gtsmodel.Report + testMentions map[string]*gtsmodel.Mention + testPollVotes map[string]*gtsmodel.PollVote + testFilters map[string]*gtsmodel.Filter + testFilterKeywords map[string]*gtsmodel.FilterKeyword + testFilterStatues map[string]*gtsmodel.FilterStatus typeconverter *typeutils.Converter } @@ -506,6 +509,9 @@ func (suite *TypeUtilsTestSuite) SetupTest() { suite.testReports = testrig.NewTestReports() suite.testMentions = testrig.NewTestMentions() suite.testPollVotes = testrig.NewTestPollVotes() + suite.testFilters = testrig.NewTestFilters() + suite.testFilterKeywords = testrig.NewTestFilterKeywords() + suite.testFilterStatues = testrig.NewTestFilterStatuses() suite.typeconverter = typeutils.NewConverter(&suite.state) testrig.StandardDBSetup(suite.db, nil) -- cgit v1.2.3