projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'fix/mastoapi-more-object-preloads' 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 82f8cd0207d0589b8361b47381e105684e4ccb3b..72c092f252e6e8c604b7eb3db956bd856f929a3f 100644
(file)
--- a/
lib/pleroma/web/mastodon_api/views/account_view.ex
+++ b/
lib/pleroma/web/mastodon_api/views/account_view.ex
@@
-72,6
+72,13
@@
defmodule Pleroma.Web.MastodonAPI.AccountView do
image = User.avatar_url(user) |> MediaProxy.url()
header = User.banner_url(user) |> MediaProxy.url()
user_info = User.get_cached_user_info(user)
image = User.avatar_url(user) |> MediaProxy.url()
header = User.banner_url(user) |> MediaProxy.url()
user_info = User.get_cached_user_info(user)
+
+ following_count =
+ ((!user.info.hide_follows or opts[:for] == user) && user_info.following_count) || 0
+
+ followers_count =
+ ((!user.info.hide_followers or opts[:for] == user) && user_info.follower_count) || 0
+
bot = (user.info.source_data["type"] || "Person") in ["Application", "Service"]
emojis =
bot = (user.info.source_data["type"] || "Person") in ["Application", "Service"]
emojis =
@@
-102,11
+109,11
@@
defmodule Pleroma.Web.MastodonAPI.AccountView do
display_name: display_name,
locked: user_info.locked,
created_at: Utils.to_masto_date(user.inserted_at),
display_name: display_name,
locked: user_info.locked,
created_at: Utils.to_masto_date(user.inserted_at),
- followers_count:
user_info.follower
_count,
- following_count:
user_info.
following_count,
+ followers_count:
followers
_count,
+ following_count: following_count,
statuses_count: user_info.note_count,
note: bio || "",
statuses_count: user_info.note_count,
note: bio || "",
- url:
user.ap_id
,
+ url:
User.profile_url(user)
,
avatar: image,
avatar_static: image,
header: header,
avatar: image,
avatar_static: image,
header: header,