diff options
author | lain <lain@soykaf.club> | 2018-12-05 21:27:56 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-12-05 21:27:56 +0100 |
commit | 76d6b1c6ab2813b1fb8f4473e4d722cc32fb2fed (patch) | |
tree | 5308f2d4c169085dfbe22a95a86c5271e4285ace /lib/pleroma/web/twitter_api/twitter_api_controller.ex | |
parent | 3ea4476445a5e9b6ec1625d7caa537f79254e9d0 (diff) | |
parent | 5f0c2372bc8be3763b649b13ee142c273583329e (diff) | |
download | pleroma-76d6b1c6ab2813b1fb8f4473e4d722cc32fb2fed.tar.gz |
Merge remote-tracking branch 'origin' into follower-hiding
Diffstat (limited to 'lib/pleroma/web/twitter_api/twitter_api_controller.ex')
-rw-r--r-- | lib/pleroma/web/twitter_api/twitter_api_controller.ex | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/lib/pleroma/web/twitter_api/twitter_api_controller.ex b/lib/pleroma/web/twitter_api/twitter_api_controller.ex index 591557cca..8fd6ea078 100644 --- a/lib/pleroma/web/twitter_api/twitter_api_controller.ex +++ b/lib/pleroma/web/twitter_api/twitter_api_controller.ex @@ -462,27 +462,16 @@ defmodule Pleroma.Web.TwitterAPI.Controller do User.Info.profile_update(user.info, info_params) end - defp add_profile_emoji(user, params) do + defp parse_profile_bio(user, params) do if bio = params["description"] do - mentions = Formatter.parse_mentions(bio) - tags = Formatter.parse_tags(bio) - - emoji = - (user.info.source_data["tag"] || []) - |> Enum.filter(fn %{"type" => t} -> t == "Emoji" end) - |> Enum.map(fn %{"icon" => %{"url" => url}, "name" => name} -> - {String.trim(name, ":"), url} - end) - - bio_html = CommonUtils.format_input(bio, mentions, tags, "text/plain") - Map.put(params, "bio", bio_html |> Formatter.emojify(emoji)) + Map.put(params, "bio", User.parse_bio(bio, user)) else params end end def update_profile(%{assigns: %{user: user}} = conn, params) do - params = add_profile_emoji(user, params) + params = parse_profile_bio(user, params) info_cng = build_info_cng(user, params) with changeset <- User.update_changeset(user, params), |