Verified Commit a5adb251 authored by Haelwenn's avatar Haelwenn

[Pleroma.Web.MastodonAPI.AccountView]: Add fields support

parent d008f2d6
......@@ -27,6 +27,11 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
}
end)
fields =
(user.info["source_data"]["attachment"] || [])
|> Enum.filter(fn %{"type" => t} -> t == "PropertyValue" end)
|> Enum.map(fn fields -> Map.take(fields, ["name", "value"]) end)
%{
id: to_string(user.id),
username: hd(String.split(user.nickname, "@")),
......@@ -44,7 +49,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
header: header,
header_static: header,
emojis: emojis,
fields: [],
fields: fields,
bot: bot,
source: %{
note: "",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment