Add profile custom fields to ActivityPub.UserView

This commit is contained in:
Egor Kislitsyn 2019-07-25 19:35:34 +07:00
commit 88598c9baf
2 changed files with 22 additions and 0 deletions

View file

@ -80,6 +80,11 @@ defmodule Pleroma.Web.ActivityPub.UserView do
|> Transmogrifier.add_emoji_tags()
|> Map.get("tag", [])
fields =
user.info
|> User.Info.fields()
|> Enum.map(&Map.put(&1, "type", "PropertyValue"))
%{
"id" => user.ap_id,
"type" => "Person",
@ -98,6 +103,7 @@ defmodule Pleroma.Web.ActivityPub.UserView do
"publicKeyPem" => public_key
},
"endpoints" => endpoints,
"attachment" => fields,
"tag" => (user.info.source_data["tag"] || []) ++ user_tags
}
|> Map.merge(maybe_make_image(&User.avatar_url/2, "icon", user))