From 046741c60d46d5f4de5356af79022bcb05bbaad6 Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Fri, 10 Aug 2018 01:19:00 +0200 Subject: [PATCH] [Pleroma.Web.MastodonAPI.StatusView] Support Peertube Video titles --- lib/pleroma/web/mastodon_api/views/status_view.ex | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index 7226a407e..3eca43a92 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -211,6 +211,19 @@ def get_visibility(object) do end end + def render_content(%{"type" => "Video"} = object) do + name = object["name"] + + content = + if !!name and name != "" do + "

#{name}

#{object["content"]}" + else + object["content"] + end + + HtmlSanitizeEx.basic_html(content) + end + def render_content(%{"type" => "Article"} = object) do summary = object["name"]