X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fweb%2Fmastodon_api%2Fviews%2Faccount_view.ex;h=d2a4dd3669fa5fae8f24734fecb1b216136cf879;hb=ad0ab3a57bc5591806cae0201d8077ffb10b6634;hp=02f1e60bb889d661883a553c64002c178f8b62b3;hpb=a6f65083aeed755d31134144b973d87575ae549e;p=akkoma diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex index 02f1e60bb..d2a4dd366 100644 --- a/lib/pleroma/web/mastodon_api/views/account_view.ex +++ b/lib/pleroma/web/mastodon_api/views/account_view.ex @@ -3,20 +3,17 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do alias Pleroma.User alias Pleroma.Web.MastodonAPI.AccountView alias Pleroma.Web.CommonAPI.Utils - - defp image_url(%{"url" => [ %{ "href" => href } | _ ]}), do: href - defp image_url(_), do: nil + alias Pleroma.Web.MediaProxy def render("accounts.json", %{users: users} = opts) do render_many(users, AccountView, "account.json", opts) end def render("account.json", %{user: user}) do - image = User.avatar_url(user) + image = User.avatar_url(user) |> MediaProxy.url() + header = User.banner_url(user) |> MediaProxy.url() user_info = User.user_info(user) - header = image_url(user.info["banner"]) || "https://placehold.it/700x335" - %{ id: to_string(user.id), username: hd(String.split(user.nickname, "@")),