Merge branch 'fix/blocked-user-boosts' into 'develop'

ActivityPub.ex: do not return boosted statuses from blocked users.

See merge request pleroma/pleroma!111
This commit is contained in:
lambda 2018-04-28 13:49:12 +00:00
commit a7a40bb8f1
2 changed files with 23 additions and 1 deletions

View file

@ -313,7 +313,10 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
defp restrict_blocked(query, %{"blocking_user" => %User{info: info}}) do
blocks = info["blocks"] || []
from(activity in query, where: fragment("not (? = ANY(?))", activity.actor, ^blocks))
from(activity in query,
where: fragment("not (? = ANY(?))", activity.actor, ^blocks),
where: fragment("not (?->'to' \\?| ?)", activity.data, ^blocks)
)
end
defp restrict_blocked(query, _), do: query