aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-07-08 05:56:24 +0200
committerHaelwenn (lanodan) Monnier <contact@hacktivis.me>2020-07-08 06:28:40 +0200
commit312fc55f14e1b7f88ec43b72c577bf5df595beac (patch)
tree78dcafbc755dfabea5fd201f5e46a887c0db0b7e /lib
parent8c9df2d2e6a5a3639f6b411cd3e9b57248a0650c (diff)
downloadpleroma-312fc55f14e1b7f88ec43b72c577bf5df595beac.tar.gz
Add [:instances_favicons, :enabled] setting, defaults to false
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/mastodon_api/views/account_view.ex16
1 files changed, 10 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 db5739254..2feba4778 100644
--- a/lib/pleroma/web/mastodon_api/views/account_view.ex
+++ b/lib/pleroma/web/mastodon_api/views/account_view.ex
@@ -205,12 +205,16 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do
end
favicon =
- user
- |> Map.get(:ap_id, "")
- |> URI.parse()
- |> URI.merge("/")
- |> Pleroma.Instances.Instance.get_or_update_favicon()
- |> MediaProxy.url()
+ if Pleroma.Config.get([:instances_favicons, :enabled]) do
+ user
+ |> Map.get(:ap_id, "")
+ |> URI.parse()
+ |> URI.merge("/")
+ |> Pleroma.Instances.Instance.get_or_update_favicon()
+ |> MediaProxy.url()
+ else
+ nil
+ end
%{
id: to_string(user.id),