mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-23 23:11:13 +00:00
ActivityPub.ex: filter domain blocked activities.
This commit is contained in:
parent
4856962434
commit
9075b6d25b
|
@ -439,11 +439,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
||||||
|
|
||||||
defp restrict_blocked(query, %{"blocking_user" => %User{info: info}}) do
|
defp restrict_blocked(query, %{"blocking_user" => %User{info: info}}) do
|
||||||
blocks = info["blocks"] || []
|
blocks = info["blocks"] || []
|
||||||
|
domain_blocks = info["domain_blocks"] || []
|
||||||
|
|
||||||
from(
|
from(
|
||||||
activity in query,
|
activity in query,
|
||||||
where: fragment("not (? = ANY(?))", activity.actor, ^blocks),
|
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
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue