aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2018-08-10 01:19:00 +0200
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2018-08-21 18:34:56 +0200
commit046741c60d46d5f4de5356af79022bcb05bbaad6 (patch)
tree3c0f7d6d4550bc16bf0a326d1c32a42c3920649c /lib
parentf5b056e3ce0d160427025e46f405d6d277c2970b (diff)
downloadpleroma-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.ex13
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"]