mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 04:52:24 -05:00
[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>
This commit is contained in:
parent
7f8cb204cd
commit
fb2ef90ec5
7 changed files with 20 additions and 4 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue