diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-08-22 20:59:58 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-08-22 20:59:58 +0300 |
commit | 256ff09aa8068166a9f83e3159f060fd4598af76 (patch) | |
tree | a5e5efa83241f28d8d241b9d2d95ca4ceaefd286 /lib/pleroma/web/twitter_api | |
parent | 8778c16dac1789eeb6dd51524573163216200b5d (diff) | |
parent | 73884441f31092bdb2f509950daf9bd3889a9a8b (diff) | |
download | pleroma-256ff09aa8068166a9f83e3159f060fd4598af76.tar.gz |
[#1149] Merge remote-tracking branch 'remotes/upstream/develop' into 1149-oban-job-queue
# Conflicts:
# lib/pleroma/application.ex
# lib/pleroma/scheduled_activity_worker.ex
# lib/pleroma/web/federator/retry_queue.ex
# lib/pleroma/web/oauth/token/clean_worker.ex
# test/user_test.exs
# test/web/federator_test.exs
Diffstat (limited to 'lib/pleroma/web/twitter_api')
-rw-r--r-- | lib/pleroma/web/twitter_api/views/user_view.ex | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/pleroma/web/twitter_api/views/user_view.ex b/lib/pleroma/web/twitter_api/views/user_view.ex index 8d8892068..8a7d2fc72 100644 --- a/lib/pleroma/web/twitter_api/views/user_view.ex +++ b/lib/pleroma/web/twitter_api/views/user_view.ex @@ -74,12 +74,15 @@ defmodule Pleroma.Web.TwitterAPI.UserView do |> HTML.filter_tags(User.html_filter_policy(for_user)) |> Formatter.emojify(emoji) - # ``fields`` is an array of mastodon profile field, containing ``{"name": "…", "value": "…"}``. - # For example: [{"name": "Pronoun", "value": "she/her"}, …] fields = - (user.info.source_data["attachment"] || []) - |> Enum.filter(fn %{"type" => t} -> t == "PropertyValue" end) - |> Enum.map(fn fields -> Map.take(fields, ["name", "value"]) end) + user.info + |> User.Info.fields() + |> Enum.map(fn %{"name" => name, "value" => value} -> + %{ + "name" => Pleroma.HTML.strip_tags(name), + "value" => Pleroma.HTML.filter_tags(value, Pleroma.HTML.Scrubber.LinksOnly) + } + end) data = %{ |