summaryrefslogtreecommitdiff
path: root/internal/filter
diff options
context:
space:
mode:
authorLibravatar nicole mikołajczyk <git@mkljczk.pl>2025-08-13 13:23:42 +0200
committerLibravatar kim <gruf@noreply.codeberg.org>2025-08-13 13:23:42 +0200
commitfb2ef90ec51c47c801d290f2f6ff2289121cbeb1 (patch)
tree05ad2712b7c06209179af5bb9ac170203ccab0c6 /internal/filter
parent[feature] 2fa management via CLI (#4368) (diff)
downloadgotosocial-fb2ef90ec51c47c801d290f2f6ff2289121cbeb1.tar.xz
[feature] support blur filter action (#4371)
This pull request implements the `blur` value of `filter_action` for status filtering. It was introduced by Mastodon 4.4.0. [Related docs update](https://github.com/mastodon/documentation/pull/1620) Signed-off-by: nicole mikołajczyk <git@mkljczk.pl> Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4371 Reviewed-by: kim <gruf@noreply.codeberg.org> Co-authored-by: nicole mikołajczyk <git@mkljczk.pl> Co-committed-by: nicole mikołajczyk <git@mkljczk.pl>
Diffstat (limited to 'internal/filter')
-rw-r--r--internal/filter/status/api.go2
-rw-r--r--internal/filter/status/status.go4
2 files changed, 4 insertions, 2 deletions
diff --git a/internal/filter/status/api.go b/internal/filter/status/api.go
index 1d6684b59..bca82a15e 100644
--- a/internal/filter/status/api.go
+++ b/internal/filter/status/api.go
@@ -100,6 +100,8 @@ func toAPIFilterAction(m gtsmodel.FilterAction) apimodel.FilterAction {
return apimodel.FilterActionWarn
case gtsmodel.FilterActionHide:
return apimodel.FilterActionHide
+ case gtsmodel.FilterActionBlur:
+ return apimodel.FilterActionBlur
}
return apimodel.FilterActionNone
}
diff --git a/internal/filter/status/status.go b/internal/filter/status/status.go
index e38131ae3..572f669d5 100644
--- a/internal/filter/status/status.go
+++ b/internal/filter/status/status.go
@@ -208,8 +208,8 @@ func (f *Filter) getStatusFilterResults(
var apiResult *apimodel.FilterResult
switch filter.Action {
- case gtsmodel.FilterActionWarn:
- // For filter action WARN get all possible filter matches against status.
+ case gtsmodel.FilterActionWarn, gtsmodel.FilterActionBlur:
+ // For filter action WARN or BLUR get all possible filter matches against status.
keywordMatches, statusMatches := getFilterMatches(filter, status.ID, fields)
if len(keywordMatches) == 0 && len(statusMatches) == 0 {
continue