Merge branch 'feature/custom-fields' into 'develop'

Add custom profile fields

See merge request pleroma/pleroma!1488
This commit is contained in:
lain 2019-08-20 12:44:14 +00:00
commit ef43016b2c
18 changed files with 365 additions and 27 deletions

View file

@ -1023,6 +1023,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
"url" => [%{"href" => data["image"]["url"]}]
}
fields =
data
|> Map.get("attachment", [])
|> Enum.filter(fn %{"type" => t} -> t == "PropertyValue" end)
|> Enum.map(fn fields -> Map.take(fields, ["name", "value"]) end)
locked = data["manuallyApprovesFollowers"] || false
data = Transmogrifier.maybe_fix_user_object(data)
@ -1032,6 +1038,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
ap_enabled: true,
source_data: data,
banner: banner,
fields: fields,
locked: locked
},
avatar: avatar,