alias Pleroma.Activity
alias Pleroma.HTML
+ alias Pleroma.Maps
alias Pleroma.Object
alias Pleroma.Repo
alias Pleroma.User
media_type = attachment_url["mediaType"] || attachment_url["mimeType"] || "image"
href = attachment_url["href"] |> MediaProxy.url()
href_preview = attachment_url["href"] |> MediaProxy.preview_url()
+ meta = render("attachment_meta.json", %{attachment: attachment})
type =
cond do
type: type,
description: attachment["name"],
pleroma: %{mime_type: media_type},
- meta: render("attachment_meta.json", %{attachment: attachment}),
blurhash: attachment["blurhash"]
}
+ |> Maps.put_if_present(:meta, meta)
end
def render("attachment_meta.json", %{
}
end
- def render("attachment_meta.json", _), do: %{}
+ def render("attachment_meta.json", _), do: nil
def render("context.json", %{activity: activity, activities: activities, user: user}) do
%{ancestors: ancestors, descendants: descendants} =