Added the ability to upload background, logo, default user avatar, instance thumbnail, and the NSFW hiding image via AdminFE

This commit is contained in:
eugenijm 2020-04-12 22:54:43 +03:00
commit b7fc61e17b
7 changed files with 48 additions and 7 deletions

View file

@ -305,8 +305,13 @@ defmodule Pleroma.User do
def avatar_url(user, options \\ []) do
case user.avatar do
%{"url" => [%{"href" => href} | _]} -> href
_ -> !options[:no_default] && "#{Web.base_url()}/images/avi.png"
%{"url" => [%{"href" => href} | _]} ->
href
_ ->
unless options[:no_default] do
Config.get([:assets, :default_user_avatar], "#{Web.base_url()}/images/avi.png")
end
end
end