mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-26 16:02:18 +00:00
ActivityPub: Use recipients fields.
This commit is contained in:
parent
5454ec6a6c
commit
7851b9ba81
|
@ -140,11 +140,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
|
||||||
defp restrict_tag(query, _), do: query
|
defp restrict_tag(query, _), do: query
|
||||||
|
|
||||||
defp restrict_recipients(query, recipients) do
|
defp restrict_recipients(query, recipients) do
|
||||||
Enum.reduce(recipients, query, fn (recipient, q) ->
|
from activity in query,
|
||||||
map = %{ to: [recipient] }
|
where: fragment("? && ?", ^recipients, activity.recipients)
|
||||||
from activity in q,
|
|
||||||
or_where: fragment(~s(? @> ?), activity.data, ^map)
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
defp restrict_local(query, %{"local_only" => true}) do
|
defp restrict_local(query, %{"local_only" => true}) do
|
||||||
|
|
Loading…
Reference in a new issue