activitypub: use jsonb query for containment instead of recipients_to/recipients_cc.
authorWilliam Pitcock <nenolod@dereferenced.org>
Wed, 29 Aug 2018 18:32:04 +0000 (18:32 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Wed, 29 Aug 2018 18:41:02 +0000 (18:41 +0000)
lib/pleroma/web/activity_pub/activity_pub.ex

index dad9c4865b0010c8329c5f1a6cddb97d1d8ff344..116dbcf1ef50578f047f337dab354ca629f96cc9 100644 (file)
@@ -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