Fix pagination in AP outbox.json
authorD Anzorge <d.anzorge@gmail.com>
Thu, 19 Sep 2019 14:09:07 +0000 (16:09 +0200)
committerD Anzorge <d.anzorge@gmail.com>
Thu, 19 Sep 2019 14:09:07 +0000 (16:09 +0200)
lib/pleroma/web/activity_pub/views/user_view.ex

index 164b973d0816dbc4fdc4b3a7a6a1f284c987bfd1..a2f73e140f3f6adcdd1cf2cc844d235575ab1d4d 100644 (file)
@@ -227,11 +227,12 @@ defmodule Pleroma.Web.ActivityPub.UserView do
 
     activities = ActivityPub.fetch_user_activities(user, nil, params)
 
+    # this is sorted chronologically, so first activity is the newest (max)
     {max_id, min_id, collection} =
       if length(activities) > 0 do
         {
-          Enum.at(Enum.reverse(activities), 0).id,
           Enum.at(activities, 0).id,
+          Enum.at(Enum.reverse(activities), 0).id,
           Enum.map(activities, fn act ->
             {:ok, data} = Transmogrifier.prepare_outgoing(act.data)
             data