diff options
author | scarlett <nia@netbsd.org> | 2019-01-05 21:52:02 +0000 |
---|---|---|
committer | scarlett <nia@netbsd.org> | 2019-01-05 21:52:02 +0000 |
commit | 145d6fe6e9f3c9414b1231da7f200e007413b31b (patch) | |
tree | 3e5a3d4c66a81afa1590c3365142ab5358cc7cc8 /lib | |
parent | ba17518a0aff404e265f4aebec1257912ad2750c (diff) | |
parent | 57df7d6e1da1a94a3866afc9b6d353aea602d4d3 (diff) | |
download | pleroma-145d6fe6e9f3c9414b1231da7f200e007413b31b.tar.gz |
Merge branch 'emoji-in-summary' into 'develop'
Strip HTML in and allow emoji in summaries.
See merge request pleroma/pleroma!631
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/common_api/common_api.ex | 2 | ||||
-rw-r--r-- | lib/pleroma/web/twitter_api/representers/activity_representer.ex | 2 | ||||
-rw-r--r-- | lib/pleroma/web/twitter_api/views/activity_view.ex | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index e474653ff..bb3c38f00 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -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) diff --git a/lib/pleroma/web/twitter_api/representers/activity_representer.ex b/lib/pleroma/web/twitter_api/representers/activity_representer.ex index 2a221cc66..245cd52fd 100644 --- a/lib/pleroma/web/twitter_api/representers/activity_representer.ex +++ b/lib/pleroma/web/twitter_api/representers/activity_representer.ex @@ -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 diff --git a/lib/pleroma/web/twitter_api/views/activity_view.ex b/lib/pleroma/web/twitter_api/views/activity_view.ex index a0be5cfc5..ad0cc76ed 100644 --- a/lib/pleroma/web/twitter_api/views/activity_view.ex +++ b/lib/pleroma/web/twitter_api/views/activity_view.ex @@ -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 |