Merge branch 'bugfix/filter-boosted-blocks' into 'develop'

activitypub: fix filtering of boosts from blocked users

See merge request pleroma/pleroma!1074
This commit is contained in:
Haelwenn 2019-04-18 18:29:57 +00:00
commit eba3db0966
2 changed files with 29 additions and 0 deletions

View file

@ -713,6 +713,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
activity in query,
where: fragment("not (? = ANY(?))", activity.actor, ^blocks),
where: fragment("not (? && ?)", activity.recipients, ^blocks),
where:
fragment(
"not (?->>'type' = 'Announce' and ?->'to' \\?| ?)",
activity.data,
activity.data,
^blocks
),
where: fragment("not (split_part(?, '/', 3) = ANY(?))", activity.actor, ^domain_blocks)
)
end