aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoger Braun <rbraun@Bobble.local>2017-10-18 11:56:47 +0200
committerRoger Braun <rbraun@Bobble.local>2017-10-18 11:56:47 +0200
commita17b2613795b24162e953dd457b411dddc0c902e (patch)
treebbbd5870eba280b67401e9b595eacb719e6ae73f /lib
parentb4f055b60416986220d905bbf688f8417cd8a270 (diff)
downloadpleroma-a17b2613795b24162e953dd457b411dddc0c902e.tar.gz
Simplify query.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/activity_pub/activity_pub.ex7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
index 31aa2c4f1..7a1566156 100644
--- a/lib/pleroma/web/activity_pub/activity_pub.ex
+++ b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -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