From: Haelwenn (lanodan) Monnier Date: Sat, 17 Nov 2018 17:34:45 +0000 (+0100) Subject: transmogrifier: When it’s a Video move "url" to "attachment" X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=3aff8067e4b65962fe65812807cbb52bd971ddd8;p=akkoma transmogrifier: When it’s a Video move "url" to "attachment" --- diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index e6af4b211..d5cc82918 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -69,8 +69,8 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do def fix_object(object) do object |> fix_actor - |> fix_attachments |> fix_url + |> fix_attachments |> fix_context |> fix_in_reply_to |> fix_emoji @@ -200,8 +200,14 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do true -> "" end - object - |> Map.put("url", url_string) + if Map.get(object, "type") == "Video" do + object + |> Map.delete("url") + |> Map.put("attachment", url_string) + else + object + |> Map.put("url", url_string) + end end def fix_url(object), do: object