mastodon api: default attachment type to image if one is not present

This commit is contained in:
William Pitcock 2018-09-19 04:57:28 +00:00
parent 47c9b972b9
commit 0cac493fdc
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ def render("status.json", %{activity: %{data: %{"object" => object}} = activity}
def render("attachment.json", %{attachment: attachment}) do def render("attachment.json", %{attachment: attachment}) do
[attachment_url | _] = attachment["url"] [attachment_url | _] = attachment["url"]
media_type = attachment_url["mediaType"] || attachment_url["mimeType"] media_type = attachment_url["mediaType"] || attachment_url["mimeType"] || "image"
href = attachment_url["href"] href = attachment_url["href"]
type = type =