From 72ba5b4ab73ff725b91888e38af612082f8df5ad Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 14 Feb 2019 03:13:07 +0000 Subject: [PATCH] activitypub: user view: formatting --- lib/pleroma/web/activity_pub/views/user_view.ex | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/web/activity_pub/views/user_view.ex b/lib/pleroma/web/activity_pub/views/user_view.ex index dd1ab3d2b..c8e154989 100644 --- a/lib/pleroma/web/activity_pub/views/user_view.ex +++ b/lib/pleroma/web/activity_pub/views/user_view.ex @@ -104,6 +104,7 @@ def render("following.json", %{user: user, page: page}) do query = User.get_friends_query(user) query = from(user in query, select: [:ap_id]) following = Repo.all(query) + total = if !user.info.hide_follows do length(following) @@ -119,6 +120,7 @@ def render("following.json", %{user: user}) do query = User.get_friends_query(user) query = from(user in query, select: [:ap_id]) following = Repo.all(query) + total = if !user.info.hide_follows do length(following) @@ -139,6 +141,7 @@ def render("followers.json", %{user: user, page: page}) do query = User.get_followers_query(user) query = from(user in query, select: [:ap_id]) followers = Repo.all(query) + total = if !user.info.hide_followers do length(followers) @@ -154,6 +157,7 @@ def render("followers.json", %{user: user}) do query = User.get_followers_query(user) query = from(user in query, select: [:ap_id]) followers = Repo.all(query) + total = if !user.info.hide_followers do length(followers) @@ -165,7 +169,8 @@ def render("followers.json", %{user: user}) do "id" => "#{user.ap_id}/followers", "type" => "OrderedCollection", "totalItems" => total, - "first" => collection(followers, "#{user.ap_id}/followers", 1, !user.info.hide_followers, total) + "first" => + collection(followers, "#{user.ap_id}/followers", 1, !user.info.hide_followers, total) } |> Map.merge(Utils.make_json_ld_header()) end