Unify object representation.
This commit is contained in:
parent
2b5d265954
commit
82e34cae95
2 changed files with 13 additions and 8 deletions
|
|
@ -1,5 +1,6 @@
|
|||
defmodule Pleroma.Web.ActivityPub.ObjectView do
|
||||
use Pleroma.Web, :view
|
||||
alias Pleroma.Web.ActivityPub.Transmogrifier
|
||||
|
||||
def render("object.json", %{object: object}) do
|
||||
base = %{
|
||||
|
|
@ -20,8 +21,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectView do
|
|||
]
|
||||
}
|
||||
|
||||
additional = Map.take(object.data, ["id", "to", "cc", "actor", "content", "summary", "type"])
|
||||
|> Map.put("attributedTo", object.data["actor"])
|
||||
additional = Transmogrifier.prepare_object(object.data)
|
||||
Map.merge(base, additional)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue