forked from AkkomaGang/akkoma
parent
6af164f27b
commit
38f3908c14
1 changed files with 5 additions and 2 deletions
|
@ -118,8 +118,11 @@ defp restrict_tag(query, %{"tag" => tag}) do
|
|||
defp restrict_tag(query, _), do: query
|
||||
|
||||
defp restrict_recipients(query, recipients) do
|
||||
from activity in query,
|
||||
where: fragment("?->'to' \\\?| ? ", activity.data, ^recipients)
|
||||
Enum.reduce(recipients, query, fn (recipient, q) ->
|
||||
map = %{ to: [recipient] }
|
||||
from activity in q,
|
||||
or_where: fragment(~s(? @> ?), activity.data, ^map)
|
||||
end)
|
||||
end
|
||||
|
||||
defp restrict_local(query, %{"local_only" => true}) do
|
||||
|
|
Loading…
Reference in a new issue