aboutsummaryrefslogtreecommitdiff
path: root/lib/pleroma/web
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pleroma/web')
-rw-r--r--lib/pleroma/web/mastodon_api/views/account_view.ex6
-rw-r--r--lib/pleroma/web/twitter_api/views/user_view.ex2
2 files changed, 2 insertions, 6 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex
index 1d5918988..d2a4dd366 100644
--- a/lib/pleroma/web/mastodon_api/views/account_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/account_view.ex
@@ -5,19 +5,15 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Web.MediaProxy
- defp image_url(%{"url" => [ %{ "href" => href } | _ ]}), do: href
- defp image_url(_), do: nil
-
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) |> 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") |> MediaProxy.url()
-
%{
id: to_string(user.id),
username: hd(String.split(user.nickname, "@")),
diff --git a/lib/pleroma/web/twitter_api/views/user_view.ex b/lib/pleroma/web/twitter_api/views/user_view.ex
index cc6b450fb..1b995f42f 100644
--- a/lib/pleroma/web/twitter_api/views/user_view.ex
+++ b/lib/pleroma/web/twitter_api/views/user_view.ex
@@ -45,7 +45,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
"screen_name" => user.nickname,
"statuses_count" => user_info[:note_count],
"statusnet_profile_url" => user.ap_id,
- "cover_photo" => image_url(user.info["banner"]) |> MediaProxy.url(),
+ "cover_photo" => User.banner_url(user) |> MediaProxy.url(),
"background_image" => image_url(user.info["background"]) |> MediaProxy.url(),
}