activitypub: mrf: tag policy: fix force-unlisted and sandbox actions
authorWilliam Pitcock <nenolod@dereferenced.org>
Mon, 4 Feb 2019 19:03:25 +0000 (19:03 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Mon, 4 Feb 2019 19:03:54 +0000 (19:03 +0000)
lib/pleroma/web/activity_pub/mrf/tag_policy.ex

index 901a0f2b00c38b7f92025e1a500407e97f5f9529..b242e44e69b2c2351ba8da946207722189625d35 100644 (file)
@@ -50,10 +50,16 @@ defmodule Pleroma.Web.ActivityPub.MRF.TagPolicy do
       cc =
         List.delete(cc, user.follower_address) ++ ["https://www.w3.org/ns/activitystreams#Public"]
 
+      object =
+        message["object"]
+        |> Map.put("to", to)
+        |> Map.put("cc", cc)
+
       message =
         message
         |> Map.put("to", to)
         |> Map.put("cc", cc)
+        |> Map.put("object", object)
 
       {:ok, message}
     else
@@ -74,10 +80,16 @@ defmodule Pleroma.Web.ActivityPub.MRF.TagPolicy do
 
       cc = List.delete(cc, "https://www.w3.org/ns/activitystreams#Public")
 
+      object =
+        message["object"]
+        |> Map.put("to", to)
+        |> Map.put("cc", cc)
+
       message =
         message
         |> Map.put("to", to)
         |> Map.put("cc", cc)
+        |> Map.put("object", object)
 
       {:ok, message}
     else