diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2019-02-12 14:59:34 +0100 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2019-05-03 16:27:50 +0200 |
commit | 2f76a40d028c45e99425b061298a1b05e4b59923 (patch) | |
tree | 6a3f9ee4e90915dd6d44422f92969b3d856b44c2 /lib/pleroma/web/common_api/common_api.ex | |
parent | d70af32127bda1431bacad58e7c6516a2e652fcd (diff) | |
download | pleroma-2f76a40d028c45e99425b061298a1b05e4b59923.tar.gz |
formatter.ex: Add get_emoji_map/1
Diffstat (limited to 'lib/pleroma/web/common_api/common_api.ex')
-rw-r--r-- | lib/pleroma/web/common_api/common_api.ex | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/pleroma/web/common_api/common_api.ex b/lib/pleroma/web/common_api/common_api.ex index ecd183110..b53869c75 100644 --- a/lib/pleroma/web/common_api/common_api.ex +++ b/lib/pleroma/web/common_api/common_api.ex @@ -151,8 +151,8 @@ defmodule Pleroma.Web.CommonAPI do ), {to, cc} <- to_for_user_and_mentions(user, mentions, in_reply_to, visibility), context <- make_context(in_reply_to), - cw <- data["spoiler_text"], - full_payload <- String.trim(status <> (data["spoiler_text"] || "")), + cw <- data["spoiler_text"] || "", + full_payload <- String.trim(status <> cw), length when length in 1..limit <- String.length(full_payload), object <- make_note_data( @@ -170,10 +170,7 @@ defmodule Pleroma.Web.CommonAPI do Map.put( object, "emoji", - (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) + Formatter.get_emoji_map(full_payload) ) do res = ActivityPub.create( |