|
|
@ -14,6 +14,18 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
|
|
|
|
header = User.banner_url(user) |> MediaProxy.url()
|
|
|
|
header = User.banner_url(user) |> MediaProxy.url()
|
|
|
|
user_info = User.user_info(user)
|
|
|
|
user_info = User.user_info(user)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
emojis =
|
|
|
|
|
|
|
|
(user.info["source_data"]["tag"] || [])
|
|
|
|
|
|
|
|
|> Enum.filter(fn %{"type" => t} -> t == "Emoji" end)
|
|
|
|
|
|
|
|
|> Enum.map(fn %{"icon" => %{"url" => url}, "name" => name} ->
|
|
|
|
|
|
|
|
%{
|
|
|
|
|
|
|
|
"shortcode" => String.trim(name, ":"),
|
|
|
|
|
|
|
|
"url" => MediaProxy.url(url),
|
|
|
|
|
|
|
|
"static_url" => MediaProxy.url(url),
|
|
|
|
|
|
|
|
"visible_in_picker" => false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
end)
|
|
|
|
|
|
|
|
|
|
|
|
%{
|
|
|
|
%{
|
|
|
|
id: to_string(user.id),
|
|
|
|
id: to_string(user.id),
|
|
|
|
username: hd(String.split(user.nickname, "@")),
|
|
|
|
username: hd(String.split(user.nickname, "@")),
|
|
|
@ -30,7 +42,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
|
|
|
|
avatar_static: image,
|
|
|
|
avatar_static: image,
|
|
|
|
header: header,
|
|
|
|
header: header,
|
|
|
|
header_static: header,
|
|
|
|
header_static: header,
|
|
|
|
emojis: [],
|
|
|
|
emojis: emojis,
|
|
|
|
fields: [],
|
|
|
|
fields: [],
|
|
|
|
source: %{
|
|
|
|
source: %{
|
|
|
|
note: "",
|
|
|
|
note: "",
|
|
|
|