aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2018-09-27 11:38:30 +0200
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2018-09-27 20:00:48 +0200
commit9446b02bdf2b642ee5f862c4fccbbe9217a2e3b8 (patch)
tree3808c13611263a9e5b4c9fc2590efe853b173251 /lib
parente53da692fbdae3bcf9a7d528bf0d6bd170669052 (diff)
downloadpleroma-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.ex8
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