Use info.fields instead of source_data for remote users

This commit is contained in:
Egor Kislitsyn 2019-08-06 18:21:25 +07:00
commit f7bbf99caa
10 changed files with 91 additions and 39 deletions

View file

@ -83,8 +83,13 @@ defmodule Pleroma.Web.ActivityPub.UserView do
fields =
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)
|> Enum.map(&Map.put(&1, "type", "PropertyValue"))
|> Enum.map(fn f -> Map.update!(f, "value", &AutoLinker.link(&1)) end)
%{
"id" => user.ap_id,