diff options
author | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2019-02-23 00:57:42 +0100 |
---|---|---|
committer | Haelwenn (lanodan) Monnier <contact@hacktivis.me> | 2019-05-03 16:41:23 +0200 |
commit | b5ad1715b2d4a2a5bdaefa2d56bde71120d23acb (patch) | |
tree | 9efa30a7f425eda2efe4ae3f36edc875dad73458 /lib | |
parent | 46bbf9e1cff4e00f2fbd95dcc21c038d7d686b86 (diff) | |
download | pleroma-b5ad1715b2d4a2a5bdaefa2d56bde71120d23acb.tar.gz |
MastoAPI: profile update with emoji_map
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/mastodon_api/mastodon_api_controller.ex | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex index 564dbb829..0840c2c5a 100644 --- a/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex +++ b/lib/pleroma/web/mastodon_api/mastodon_api_controller.ex @@ -9,6 +9,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do alias Pleroma.Bookmark alias Pleroma.Config alias Pleroma.Filter + alias Pleroma.Formatter alias Pleroma.Notification alias Pleroma.Object alias Pleroma.Object.Fetcher @@ -96,6 +97,12 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do end end) + emojis_text = (user_params["display_name"] || "") <> (user_params["note"] || "") + + user_info_emojis = + ((user.info.emoji || []) ++ Formatter.get_emoji_map(emojis_text)) + |> Enum.dedup() + info_params = [:no_rich_text, :locked, :hide_followers, :hide_follows, :hide_favorites, :show_role] |> Enum.reduce(%{}, fn key, acc -> @@ -112,6 +119,7 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIController do _ -> :error end end) + |> Map.put(:emoji, user_info_emojis) info_cng = User.Info.profile_update(user.info, info_params) |