From: lain Date: Thu, 15 Feb 2018 19:32:07 +0000 (+0100) Subject: ActivityPub: Use recipients fields. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=7851b9ba816148706328b7d16eef383ea9256795;p=akkoma ActivityPub: Use recipients fields. --- 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