activitypub: fix filtering of boosts from blocked users
[akkoma] / lib / pleroma / web / activity_pub / activity_pub.ex
index 68317ee6a26b75dcab03b116e73650067f066aa2..cb88ba308c105deb2d9411d257ed1eb9f75c41a0 100644 (file)
@@ -713,6 +713,13 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
       activity in query,
       where: fragment("not (? = ANY(?))", activity.actor, ^blocks),
       where: fragment("not (? && ?)", activity.recipients, ^blocks),
+      where:
+        fragment(
+          "not (?->>'type' = 'Announce' and ?->'to' \\?| ?)",
+          activity.data,
+          activity.data,
+          ^blocks
+        ),
       where: fragment("not (split_part(?, '/', 3) = ANY(?))", activity.actor, ^domain_blocks)
     )
   end