format activity_pub.ex
This commit is contained in:
parent
19d228cc58
commit
25f774f7c1
@ -915,6 +915,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||||||
defp restrict_blocked(query, %{"blocking_user" => %User{} = user}) do
|
defp restrict_blocked(query, %{"blocking_user" => %User{} = user}) do
|
||||||
blocks = user.blocks || []
|
blocks = user.blocks || []
|
||||||
domain_blocks = user.domain_blocks || []
|
domain_blocks = user.domain_blocks || []
|
||||||
|
|
||||||
following_ap_ids =
|
following_ap_ids =
|
||||||
user
|
user
|
||||||
|> User.get_friends_ap_ids()
|
|> User.get_friends_ap_ids()
|
||||||
@ -933,8 +934,22 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
|||||||
activity.data,
|
activity.data,
|
||||||
^blocks
|
^blocks
|
||||||
),
|
),
|
||||||
where: fragment("(not (split_part(?, '/', 3) = ANY(?))) or ? = ANY(?)", activity.actor, ^domain_blocks, activity.actor, ^following_ap_ids),
|
where:
|
||||||
where: fragment("(not (split_part(?->>'actor', '/', 3) = ANY(?))) or (?->>'actor') = ANY(?)", o.data, ^domain_blocks, o.data, ^following_ap_ids)
|
fragment(
|
||||||
|
"(not (split_part(?, '/', 3) = ANY(?))) or ? = ANY(?)",
|
||||||
|
activity.actor,
|
||||||
|
^domain_blocks,
|
||||||
|
activity.actor,
|
||||||
|
^following_ap_ids
|
||||||
|
),
|
||||||
|
where:
|
||||||
|
fragment(
|
||||||
|
"(not (split_part(?->>'actor', '/', 3) = ANY(?))) or (?->>'actor') = ANY(?)",
|
||||||
|
o.data,
|
||||||
|
^domain_blocks,
|
||||||
|
o.data,
|
||||||
|
^following_ap_ids
|
||||||
|
)
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user