1
0
Fork 1
mirror of https://akkoma.dev/AkkomaGang/akkoma.git synced 2024-11-19 11:29:17 +00:00

ActivityPub: Use recipients fields.

This commit is contained in:
lain 2018-02-15 20:32:07 +01:00
parent 5454ec6a6c
commit 7851b9ba81

View file

@ -140,11 +140,8 @@ defp restrict_tag(query, %{"tag" => tag}) do
defp restrict_tag(query, _), do: query
defp restrict_recipients(query, recipients) do
Enum.reduce(recipients, query, fn (recipient, q) ->
map = %{ to: [recipient] }
from activity in q,
or_where: fragment(~s(? @> ?), activity.data, ^map)
end)
from activity in query,
where: fragment("? && ?", ^recipients, activity.recipients)
end
defp restrict_local(query, %{"local_only" => true}) do