activitypub: object view: use preloaded object when possible
authorWilliam Pitcock <nenolod@dereferenced.org>
Sat, 23 Mar 2019 02:49:40 +0000 (02:49 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Sat, 23 Mar 2019 03:05:14 +0000 (03:05 +0000)
lib/pleroma/web/activity_pub/views/object_view.ex

index 84fa94e327a052bd6930b6fda6b961e846f32275..6028b773cf3d41ef36eb24c34c790800f9f0c4ec 100644 (file)
@@ -17,7 +17,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectView do
 
   def render("object.json", %{object: %Activity{data: %{"type" => "Create"}} = activity}) do
     base = Pleroma.Web.ActivityPub.Utils.make_json_ld_header()
-    object = Object.normalize(activity.data["object"])
+    object = Object.normalize(activity)
 
     additional =
       Transmogrifier.prepare_object(activity.data)
@@ -28,7 +28,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectView do
 
   def render("object.json", %{object: %Activity{} = activity}) do
     base = Pleroma.Web.ActivityPub.Utils.make_json_ld_header()
-    object = Object.normalize(activity.data["object"])
+    object = Object.normalize(activity)
 
     additional =
       Transmogrifier.prepare_object(activity.data)