Unlisted fetching: Reverse logic
authorlain <lain@soykaf.club>
Sun, 13 May 2018 09:58:03 +0000 (11:58 +0200)
committerlain <lain@soykaf.club>
Sun, 13 May 2018 09:58:03 +0000 (11:58 +0200)
Generates a faster query.

lib/pleroma/web/activity_pub/activity_pub.ex

index 8086c830cb48166e3e6de942d79d83d47bcc250c..d43f85ee4048d19c84acbc91332b1886917e4730 100644 (file)
@@ -327,7 +327,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
       activity in query,
       where:
         fragment(
-          "(?->'to' \\?| ?)",
+          "not (coalesce(?->'cc', '{}'::jsonb) \\?| ?)",
           activity.data,
           ^["https://www.w3.org/ns/activitystreams#Public"]
         )