|> 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 =
%{
"pleroma" =>
%{
"confirmation_pending" => user_info.confirmation_pending,
- "tags" => user.tags
+ "tags" => user.tags,
+ "skip_thread_containment" => user.info.skip_thread_containment
}
|> maybe_with_activation_status(user, for_user)
|> with_notification_settings(user, for_user)