Disable previews for any activity, but create

This commit is contained in:
rinpatch 2019-01-16 09:42:24 +03:00
commit dd1432d695
2 changed files with 12 additions and 3 deletions

View file

@ -71,7 +71,7 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
end)
end
defp scrub_html_and_truncate(%{data: %{ "object" => %{ "content" => content}}} = activity) do
defp scrub_html_and_truncate(%{data: %{"object" => %{"content" => content}}} = activity) do
content
# html content comes from DB already encoded, decode first and scrub after
|> HtmlEntities.decode()
@ -80,7 +80,7 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
|> Formatter.truncate()
end
defp scrub_html_and_truncate(content) do
defp scrub_html_and_truncate(content) when is_binary(content) do
content
# html content comes from DB already encoded, decode first and scrub after
|> HtmlEntities.decode()
@ -88,6 +88,7 @@ defmodule Pleroma.Web.Metadata.Providers.OpenGraph do
|> HTML.strip_tags()
|> Formatter.truncate()
end
defp attachment_url(url) do
MediaProxy.url(url)
end