From 7851b9ba816148706328b7d16eef383ea9256795 Mon Sep 17 00:00:00 2001 From: lain Date: Thu, 15 Feb 2018 20:32:07 +0100 Subject: [PATCH] ActivityPub: Use recipients fields. --- lib/pleroma/web/activity_pub/activity_pub.ex | 7 ++----- 1 file 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 a7b2988b9..4848cc542 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -140,11 +140,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("? && ?", ^recipients, activity.recipients) end defp restrict_local(query, %{"local_only" => true}) do -- 2.45.2