diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2018-08-10 01:19:00 +0200 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2018-08-21 18:34:56 +0200 |
commit | 046741c60d46d5f4de5356af79022bcb05bbaad6 (patch) | |
tree | 3c0f7d6d4550bc16bf0a326d1c32a42c3920649c /lib | |
parent | f5b056e3ce0d160427025e46f405d6d277c2970b (diff) | |
download | pleroma-046741c60d46d5f4de5356af79022bcb05bbaad6.tar.gz |
[Pleroma.Web.MastodonAPI.StatusView] Support Peertube Video titles
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/status_view.ex | 13 |
1 files changed, 13 insertions, 0 deletions
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 @@ defmodule Pleroma.Web.MastodonAPI.StatusView 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"] |