Merge branch 'emoji-in-summary' into 'develop'

Strip HTML in and allow emoji in summaries.

See merge request pleroma/pleroma!631
This commit is contained in:
scarlett 2019-01-05 21:52:02 +00:00
commit 145d6fe6e9
4 changed files with 34 additions and 5 deletions

View file

@ -124,7 +124,7 @@ defmodule Pleroma.Web.CommonAPI do
Map.put(
object,
"emoji",
Formatter.get_emoji(status)
(Formatter.get_emoji(status) ++ Formatter.get_emoji(data["spoiler_text"]))
|> Enum.reduce(%{}, fn {name, file}, acc ->
Map.put(acc, name, "#{Pleroma.Web.Endpoint.static_url()}#{file}")
end)

View file

@ -207,7 +207,7 @@ defmodule Pleroma.Web.TwitterAPI.Representers.ActivityRepresenter do
"activity_type" => "post",
"possibly_sensitive" => possibly_sensitive,
"visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object),
"summary" => object["summary"]
"summary" => HTML.strip_tags(object["summary"]) |> Formatter.emojify(object["emoji"])
}
end

View file

@ -289,7 +289,7 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
"activity_type" => "post",
"possibly_sensitive" => possibly_sensitive,
"visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object),
"summary" => summary
"summary" => HTML.strip_tags(summary) |> Formatter.emojify(object["emoji"])
}
end