projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '1723-token-fixes' into 'develop'
[akkoma]
/
lib
/
pleroma
/
web
/
mastodon_api
/
views
/
account_view.ex
diff --git
a/lib/pleroma/web/mastodon_api/views/account_view.ex
b/lib/pleroma/web/mastodon_api/views/account_view.ex
index 6c40b8ccd37ec438c9593c57bde3acfa1c2d5fd2..2feba47782dbb553908a6601a329086a3b56c3bf 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/views/account_view.ex
+++ b/
lib/pleroma/web/mastodon_api/views/account_view.ex
@@
-35,7
+35,7
@@
defmodule Pleroma.Web.MastodonAPI.AccountView do
end
def render("show.json", %{user: user} = opts) do
end
def render("show.json", %{user: user} = opts) do
- if User.visible_for
?(user, opts[:for])
do
+ if User.visible_for
(user, opts[:for]) == :visible
do
do_render("show.json", opts)
else
%{}
do_render("show.json", opts)
else
%{}
@@
-204,6
+204,18
@@
defmodule Pleroma.Web.MastodonAPI.AccountView do
%{}
end
%{}
end
+ favicon =
+ 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),
username: username_from_nickname(user.nickname),
%{
id: to_string(user.id),
username: username_from_nickname(user.nickname),
@@
-245,7
+257,8
@@
defmodule Pleroma.Web.MastodonAPI.AccountView do
hide_favorites: user.hide_favorites,
relationship: relationship,
skip_thread_containment: user.skip_thread_containment,
hide_favorites: user.hide_favorites,
relationship: relationship,
skip_thread_containment: user.skip_thread_containment,
- background_image: image_url(user.background) |> MediaProxy.url()
+ background_image: image_url(user.background) |> MediaProxy.url(),
+ favicon: favicon
}
}
|> maybe_put_role(user, opts[:for])
}
}
|> maybe_put_role(user, opts[:for])