X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=inline;f=lib%2Fpleroma%2Fweb%2Factivity_pub%2Fviews%2Fobject_view.ex;h=8a3e4d77b1f37fb7690714da917409a3a5b85f71;hb=c435de426d045118ed7be3d77f659f349d2d2245;hp=b5c9bf8d089537e18fe49f2c7b36714c963f5b98;hpb=90e157ef803296989b41d1fbfb5096b39320f75d;p=akkoma
diff --git a/lib/pleroma/web/activity_pub/views/object_view.ex b/lib/pleroma/web/activity_pub/views/object_view.ex
index b5c9bf8d0..8a3e4d77b 100644
--- a/lib/pleroma/web/activity_pub/views/object_view.ex
+++ b/lib/pleroma/web/activity_pub/views/object_view.ex
@@ -1,10 +1,11 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2019 Pleroma Authors
+# Copyright © 2017-2021 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.ActivityPub.ObjectView do
use Pleroma.Web, :view
- alias Pleroma.{Object, Activity}
+ alias Pleroma.Activity
+ alias Pleroma.Object
alias Pleroma.Web.ActivityPub.Transmogrifier
def render("object.json", %{object: %Object{} = object}) do
@@ -14,9 +15,10 @@ defmodule Pleroma.Web.ActivityPub.ObjectView do
Map.merge(base, additional)
end
- def render("object.json", %{object: %Activity{data: %{"type" => "Create"}} = activity}) do
+ def render("object.json", %{object: %Activity{data: %{"type" => activity_type}} = activity})
+ when activity_type in ["Create", "Listen"] do
base = Pleroma.Web.ActivityPub.Utils.make_json_ld_header()
- object = Object.normalize(activity.data["object"])
+ object = Object.normalize(activity, fetch: false)
additional =
Transmogrifier.prepare_object(activity.data)
@@ -27,7 +29,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, fetch: false)
additional =
Transmogrifier.prepare_object(activity.data)