[Pleroma.Web.MastodonAPI.StatusView] Support Peertube Video titles

This commit is contained in:
Haelwenn (lanodan) Monnier 2018-08-10 01:19:00 +02:00
parent f5b056e3ce
commit 046741c60d
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE
1 changed files with 13 additions and 0 deletions

View File

@ -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
"<p><a href=\"#{object["url"]}\">#{name}</a></p>#{object["content"]}"
else
object["content"]
end
HtmlSanitizeEx.basic_html(content)
end
def render_content(%{"type" => "Article"} = object) do
summary = object["name"]