aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-08-27 17:15:23 -0500
committerMark Felder <feld@FreeBSD.org>2020-08-27 17:15:23 -0500
commit67c79394e81cf9f5404afad29a397acf32dece33 (patch)
treeabfa4eb6115eaf336e9a82ecb95fc4241a380c30 /lib
parent3a5231ec8fd0583d7f4bf05378d8bb81096c4f40 (diff)
downloadpleroma-67c79394e81cf9f5404afad29a397acf32dece33.tar.gz
Support static avatars and header images with Mediaproxy Preview
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/views/account_view.ex10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex
index 864c0417f..eef45b35d 100644
--- a/lib/pleroma/web/mastodon_api/views/account_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/account_view.ex
@@ -181,8 +181,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
user = User.sanitize_html(user, User.html_filter_policy(opts[:for]))
display_name = user.name || user.nickname
- image = User.avatar_url(user) |> MediaProxy.url()
+ avatar = User.avatar_url(user) |> MediaProxy.url()
+ avatar_static = User.avatar_url(user) |> MediaProxy.preview_url()
header = User.banner_url(user) |> MediaProxy.url()
+ header_static = User.banner_url(user) |> MediaProxy.preview_url()
following_count =
if !user.hide_follows_count or !user.hide_follows or opts[:for] == user do
@@ -247,10 +249,10 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
statuses_count: user.note_count,
note: user.bio || "",
url: user.uri || user.ap_id,
- avatar: image,
- avatar_static: image,
+ avatar: avatar,
+ avatar_static: avatar_static,
header: header,
- header_static: header,
+ header_static: header_static,
emojis: emojis,
fields: user.fields,
bot: bot,