From 3aff8067e4b65962fe65812807cbb52bd971ddd8 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 17 Nov 2018 18:34:45 +0100 Subject: [PATCH] =?utf8?q?transmogrifier:=20When=20it=E2=80=99s=20a=20Vide?= =?utf8?q?o=20move=20"url"=20to=20"attachment"?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- lib/pleroma/web/activity_pub/transmogrifier.ex | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 -- 2.45.2