diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2018-09-27 11:38:30 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2018-09-27 20:00:48 +0200 |
commit | 9446b02bdf2b642ee5f862c4fccbbe9217a2e3b8 (patch) | |
tree | 3808c13611263a9e5b4c9fc2590efe853b173251 /lib | |
parent | e53da692fbdae3bcf9a7d528bf0d6bd170669052 (diff) | |
download | pleroma-9446b02bdf2b642ee5f862c4fccbbe9217a2e3b8.tar.gz |
transmogrifier: Just make attachement maps into a list and reroll
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/transmogrifier.ex | 8 |
1 files changed, 2 insertions, 6 deletions
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 |