Rewrite block fetch query
authorFrancis Dinh <normandy@firemail.cc>
Thu, 24 May 2018 17:26:59 +0000 (13:26 -0400)
committerFrancis Dinh <normandy@firemail.cc>
Thu, 24 May 2018 17:26:59 +0000 (13:26 -0400)
lib/pleroma/web/activity_pub/utils.ex

index 3f88a467270644b71be8cf55e3709532f0975439..89d11781df3f67879daa05d03cd97292f8becdf3 100644 (file)
@@ -366,8 +366,9 @@ defmodule Pleroma.Web.ActivityPub.Utils do
           fragment(
             "? @> ?",
             activity.data,
-            ^%{type: "Block", actor: blocker_id, object: blocked_id}
+            ^%{type: "Block", object: blocked_id}
           ),
+        where: activity.actor == ^blocker_id,
         order_by: [desc: :id],
         limit: 1
       )