From: Haelwenn (lanodan) Monnier Date: Thu, 27 Sep 2018 09:38:30 +0000 (+0200) Subject: transmogrifier: Just make attachement maps into a list and reroll X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=9446b02bdf2b642ee5f862c4fccbbe9217a2e3b8;p=akkoma transmogrifier: Just make attachement maps into a list and reroll --- diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index 7bdb9594a..76998c802 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -159,12 +159,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do end def fix_attachments(%{"attachment" => attachment} = object) when is_map(attachment) do - attachment = - Map.put(attachment, "url", [ - %{"type" => "Link", "mediaType" => attachment["mediaType"], "href" => attachment["url"]} - ]) - - Map.put(object, "attachment", attachment) + Map.put(object, "attachment", [attachment]) + |> fix_attachments() end def fix_attachments(object), do: object