From c9b6220fef01dce80a31436660cd06b4e1db030f Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 24 Jul 2024 13:27:42 +0200 Subject: [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 :innocent: --------- Co-authored-by: kim --- internal/filter/interaction/filter.go | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 internal/filter/interaction/filter.go (limited to 'internal/filter/interaction/filter.go') diff --git a/internal/filter/interaction/filter.go b/internal/filter/interaction/filter.go new file mode 100644 index 000000000..49e0758c1 --- /dev/null +++ b/internal/filter/interaction/filter.go @@ -0,0 +1,34 @@ +// GoToSocial +// Copyright (C) GoToSocial Authors admin@gotosocial.org +// SPDX-License-Identifier: AGPL-3.0-or-later +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package interaction + +import ( + "github.com/superseriousbusiness/gotosocial/internal/state" +) + +// Filter packages up logic for checking whether +// an interaction is permitted within set policies. +type Filter struct { + state *state.State +} + +// NewFilter returns a new Filter +// that will use the provided state. +func NewFilter(state *state.State) *Filter { + return &Filter{state: state} +} -- cgit v1.2.3