diff --git a/lib/pleroma/web/activity_pub/transmogrifier.ex b/lib/pleroma/web/activity_pub/transmogrifier.ex index 172c1fd50..b22643b08 100644 --- a/lib/pleroma/web/activity_pub/transmogrifier.ex +++ b/lib/pleroma/web/activity_pub/transmogrifier.ex @@ -715,13 +715,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier do replies_collection = %{ "id" => object_id <> "/replies", "type" => "Collection", - "first" => %{ - "type" => "CollectionPage", - "partOf" => object_id <> "/replies", - "next" => object_id <> "/replies?only_other_accounts=true&page=true", - "items" => [] - } - # object_id <> "/replies?page=true" + "first" => object_id <> "/replies?only_other_accounts=false&page=true" } Map.merge(object, %{"replies" => replies_collection}) diff --git a/lib/pleroma/web/activity_pub/views/object_view.ex b/lib/pleroma/web/activity_pub/views/object_view.ex index 82698f688..722b5631e 100644 --- a/lib/pleroma/web/activity_pub/views/object_view.ex +++ b/lib/pleroma/web/activity_pub/views/object_view.ex @@ -50,7 +50,6 @@ defmodule Pleroma.Web.ActivityPub.ObjectView do only_other_accounts: false, iri: iri }) - |> Map.merge(%{"next" => iri <> "?only_other_accounts=true&page=true"}) |> Map.drop(["@context"]) } |> Map.merge(Utils.make_json_ld_header()) @@ -78,12 +77,22 @@ defmodule Pleroma.Web.ActivityPub.ObjectView do activity.object.data["id"] end) + next = + if !only_other_accounts do + %{ + "next" => iri <> "?only_other_accounts=true&page=true" + } + else + %{} + end + %{ "id" => iri <> "?only_other_accounts=#{only_other_accounts}&page=true", "type" => "CollectionPage", "partOf" => iri, "items" => collection } + |> Map.merge(next) |> Map.merge(Utils.make_json_ld_header()) end end