Commit 72ba5b4a authored by kaniini's avatar kaniini

activitypub: user view: formatting

parent 5307c211
......@@ -104,6 +104,7 @@ defmodule Pleroma.Web.ActivityPub.UserView 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 @@ defmodule Pleroma.Web.ActivityPub.UserView 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 @@ defmodule Pleroma.Web.ActivityPub.UserView 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 @@ defmodule Pleroma.Web.ActivityPub.UserView 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 @@ defmodule Pleroma.Web.ActivityPub.UserView 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment