From: Haelwenn (lanodan) Monnier Date: Wed, 29 Aug 2018 19:07:12 +0000 (+0200) Subject: [Pleroma.Web.MastodonAPI.StatusView]: Return nil as fallback for missing views X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=3b0e9287a5c36dea7b7a4a240a14295cb17420b4;p=akkoma [Pleroma.Web.MastodonAPI.StatusView]: Return nil as fallback for missing views --- diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index ef46ba4fc..d50e82274 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -158,6 +158,10 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do } end + def render("status.json", %{activity: %{data: %{"object" => object}} = activity} = opts) do + nil + end + def render("attachment.json", %{attachment: attachment}) do [attachment_url | _] = attachment["url"] media_type = attachment_url["mediaType"] || attachment_url["mimeType"] || "image"