Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into issue/2115
[akkoma] / lib / pleroma / web / activity_pub / activity_pub.ex
index 06e8e1a7cf84513b3b20672ef05c9eebf483c2fc..aacd58d0310d3dbed462c61f9da6073caf3fea43 100644 (file)
@@ -841,7 +841,14 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
     from(
       [activity, object: o] in query,
       where: fragment("not (? = ANY(?))", activity.actor, ^blocked_ap_ids),
-      where: fragment("not (? && ?)", activity.recipients, ^blocked_ap_ids),
+      where:
+        fragment(
+          "((not (? && ?)) or ? = ?)",
+          activity.recipients,
+          ^blocked_ap_ids,
+          activity.actor,
+          ^user.ap_id
+        ),
       where:
         fragment(
           "recipients_contain_blocked_domains(?, ?) = false",