diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-07-25 19:35:34 +0700 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-08-14 14:52:54 +0700 |
commit | 88598c9bafcdcf89b0f1fb00d0785c77b583cd65 (patch) | |
tree | 447cdd0c9f6800c993b7bca10724842a8b6da57a /lib | |
parent | a22f540fc42dd941631e94fe931d1f655b2904a1 (diff) | |
download | pleroma-88598c9bafcdcf89b0f1fb00d0785c77b583cd65.tar.gz |
Add profile custom fields to ActivityPub.UserView
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/views/user_view.ex | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/views/user_view.ex b/lib/pleroma/web/activity_pub/views/user_view.ex index 06c9e1c71..7b4bc998b 100644 --- a/lib/pleroma/web/activity_pub/views/user_view.ex +++ b/lib/pleroma/web/activity_pub/views/user_view.ex @@ -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)) |