Fix pagination in AP outbox.json

This commit is contained in:
D Anzorge 2019-09-19 16:09:07 +02:00
parent f95a2b2cda
commit 0e6085da10
1 changed files with 2 additions and 1 deletions

View File

@ -227,11 +227,12 @@ def render("outbox.json", %{user: user, max_id: max_qid}) do
activities = ActivityPub.fetch_user_activities(user, nil, params) activities = ActivityPub.fetch_user_activities(user, nil, params)
# this is sorted chronologically, so first activity is the newest (max)
{max_id, min_id, collection} = {max_id, min_id, collection} =
if length(activities) > 0 do if length(activities) > 0 do
{ {
Enum.at(Enum.reverse(activities), 0).id,
Enum.at(activities, 0).id, Enum.at(activities, 0).id,
Enum.at(Enum.reverse(activities), 0).id,
Enum.map(activities, fn act -> Enum.map(activities, fn act ->
{:ok, data} = Transmogrifier.prepare_outgoing(act.data) {:ok, data} = Transmogrifier.prepare_outgoing(act.data)
data data