From de9acebbf39ca397d9388b12b167b55110611fa6 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Wed, 29 Aug 2018 18:32:04 +0000 Subject: [PATCH] activitypub: use jsonb query for containment instead of recipients_to/recipients_cc. --- lib/pleroma/web/activity_pub/activity_pub.ex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index dad9c4865..116dbcf1e 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -415,11 +415,11 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do activity in query, where: fragment( - "(? && ?) or (? && ?)", + "(?->'to' \\?| ?) or (?->'cc' \\?| ?)", + activity.data, ^recipients_to, - activity.recipients_to, - ^recipients_cc, - activity.recipients_cc + activity.data, + ^recipients_cc ) ) end