From 3c3933e40bce7001b5025bf2e05412dd9c128f0f Mon Sep 17 00:00:00 2001 From: lain Date: Sun, 13 May 2018 11:58:03 +0200 Subject: [PATCH] Unlisted fetching: Reverse logic Generates a faster query. --- lib/pleroma/web/activity_pub/activity_pub.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 8086c830c..d43f85ee4 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -327,7 +327,7 @@ defp restrict_unlisted(query) do activity in query, where: fragment( - "(?->'to' \\?| ?)", + "not (coalesce(?->'cc', '{}'::jsonb) \\?| ?)", activity.data, ^["https://www.w3.org/ns/activitystreams#Public"] )