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/processing/workers/surfacenotify.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'internal/processing/workers/surfacenotify.go') diff --git a/internal/processing/workers/surfacenotify.go b/internal/processing/workers/surfacenotify.go index be729fa7e..a31946cc8 100644 --- a/internal/processing/workers/surfacenotify.go +++ b/internal/processing/workers/surfacenotify.go @@ -467,7 +467,12 @@ func (s *Surface) Notify( unlock() // Stream notification to the user. - apiNotif, err := s.Converter.NotificationToAPINotification(ctx, notif) + filters, err := s.State.DB.GetFiltersForAccountID(ctx, targetAccount.ID) + if err != nil { + return gtserror.Newf("couldn't retrieve filters for account %s: %w", targetAccount.ID, err) + } + + apiNotif, err := s.Converter.NotificationToAPINotification(ctx, notif, filters) if err != nil { return gtserror.Newf("error converting notification to api representation: %w", err) } -- cgit v1.2.3