From: eal Date: Sun, 3 Jun 2018 20:33:33 +0000 (+0300) Subject: ActivityPub.ex: filter domain blocked activities. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=9075b6d25b4b136bb8d8ae888bd52996a9f302e2;p=akkoma ActivityPub.ex: filter domain blocked activities. --- diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 4e0be5ba2..5c61920e5 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -439,11 +439,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do defp restrict_blocked(query, %{"blocking_user" => %User{info: info}}) do blocks = info["blocks"] || [] + domain_blocks = info["domain_blocks"] || [] from( activity in query, where: fragment("not (? = ANY(?))", activity.actor, ^blocks), - where: fragment("not (?->'to' \\?| ?)", activity.data, ^blocks) + where: fragment("not (?->'to' \\?| ?)", activity.data, ^blocks), + where: fragment("not (? ~ ANY(?))", activity.actor, ^domain_blocks) ) end