Commit 38f3908c authored by Roger Braun's avatar Roger Braun
Browse files

Revert "Simplify query."

This reverts commit a17b2613.
parent 6af164f2
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment