mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-04-09 20:44:08 +00:00
Include id for replies collection page
Signed-off-by: mkljczk <git@mkljczk.pl>
This commit is contained in:
parent
0e1a99851b
commit
1fff1d0088
1 changed files with 1 additions and 17 deletions
|
@ -39,23 +39,6 @@ defmodule Pleroma.Web.ActivityPub.ObjectView do
|
|||
Map.merge(base, additional)
|
||||
end
|
||||
|
||||
def render("replies.json", %{object: %Object{} = object, replies: replies}) do
|
||||
base = Utils.make_json_ld_header(object.data)
|
||||
|
||||
object_id = Object.normalize(object, id_only: true)
|
||||
|
||||
Map.merge(base, %{
|
||||
"id" => object_id <> "/replies",
|
||||
"type" => "Collection",
|
||||
"first" => %{
|
||||
"type" => "CollectionPage",
|
||||
"next" => object_id <> "/replies?only_other_accounts=true&page=true",
|
||||
"partOf" => object_id <> "/replies",
|
||||
"items" => replies |> Enum.map(fn object -> object.data["id"] end)
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
def render("replies_collection.json", %{user: user, object: object, iri: iri}) do
|
||||
%{
|
||||
"id" => iri,
|
||||
|
@ -96,6 +79,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectView do
|
|||
end)
|
||||
|
||||
%{
|
||||
"id" => iri <> "?only_other_accounts=#{only_other_accounts}&page=true",
|
||||
"type" => "OrderedCollectionPage",
|
||||
"partOf" => iri,
|
||||
"orderedItems" => collection
|
||||
|
|
Loading…
Reference in a new issue