summaryrefslogtreecommitdiff
path: root/internal/filter/interaction/filter.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-07-24 13:27:42 +0200
committerLibravatar GitHub <noreply@github.com>2024-07-24 12:27:42 +0100
commitc9b6220fef01dce80a31436660cd06b4e1db030f (patch)
tree5fbade865a920a5ea04fdd63763eca1880d60c5d /internal/filter/interaction/filter.go
parent[chore] renames the `GTS` caches to `DB` caches (#3127) (diff)
downloadgotosocial-c9b6220fef01dce80a31436660cd06b4e1db030f.tar.xz
[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 <grufwub@gmail.com>
Diffstat (limited to 'internal/filter/interaction/filter.go')
-rw-r--r--internal/filter/interaction/filter.go34
1 files changed, 34 insertions, 0 deletions
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 <http://www.gnu.org/licenses/>.
+
+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}
+}