mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-19 03:35:02 +00:00
Simplify query.
This commit is contained in:
parent
b4f055b604
commit
a17b261379
1 changed files with 2 additions and 5 deletions
|
@ -118,11 +118,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub 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("?->'to' \\\?| ? ", activity.data, ^recipients)
|
||||
end
|
||||
|
||||
defp restrict_local(query, %{"local_only" => true}) do
|
||||
|
|
Loading…
Reference in a new issue