activitypub: when fetching objects, use the preloaded object from the synthesized...
authorWilliam Pitcock <nenolod@dereferenced.org>
Sat, 23 Mar 2019 02:38:59 +0000 (02:38 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sat, 23 Mar 2019 03:05:10 +0000 (03:05 +0000)
lib/pleroma/web/activity_pub/activity_pub.ex

index 0441376e3974c2613f88161d5943c92cc4fac76a..80c64ae04b0a7695283bf6f22d5499c676a28982 100644 (file)
@@ -957,7 +957,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
            },
            :ok <- Transmogrifier.contain_origin(id, params),
            {:ok, activity} <- Transmogrifier.handle_incoming(params) do
-        {:ok, Object.normalize(activity.data["object"])}
+        {:ok, Object.normalize(activity)}
       else
         {:error, {:reject, nil}} ->
           {:reject, nil}
@@ -969,7 +969,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
           Logger.info("Couldn't get object via AP, trying out OStatus fetching...")
 
           case OStatus.fetch_activity_from_url(id) do
-            {:ok, [activity | _]} -> {:ok, Object.normalize(activity.data["object"])}
+            {:ok, [activity | _]} -> {:ok, Object.normalize(activity)}
             e -> e
           end
       end