activitypub: fix filtering of boosts from blocked users

This commit is contained in:
William Pitcock 2019-04-17 22:27:59 +00:00
commit 36f78c6dcd
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