diff options
author | Roger Braun <rbraun@Bobble.local> | 2017-10-19 17:56:27 +0200 |
---|---|---|
committer | Roger Braun <rbraun@Bobble.local> | 2017-10-19 17:56:27 +0200 |
commit | 38f3908c14d3b8fcfe522d4c92bde022dcc682e3 (patch) | |
tree | d3e7b90b787e6dfed9f71d224630c737ceb5d1e1 /lib | |
parent | 6af164f27b5a285fb1b1c8790a86db061c8fc28a (diff) | |
download | pleroma-38f3908c14d3b8fcfe522d4c92bde022dcc682e3.tar.gz |
Revert "Simplify query."
This reverts commit a17b2613795b24162e953dd457b411dddc0c902e.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 7a1566156..31aa2c4f1 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -118,8 +118,11 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub 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 |