transmogrifier: When it’s a Video move "url" to "attachment"

This commit is contained in:
Haelwenn (lanodan) Monnier 2018-11-17 18:34:45 +01:00 committed by William Pitcock
parent 093d39b634
commit 3aff8067e4

View File

@ -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,9 +200,15 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do
true -> ""
end
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