Do not try to guess which pagination we need by the existence of an :offset param.
authorMark Felder <feld@feld.me>
Mon, 4 Jan 2021 16:13:17 +0000 (10:13 -0600)
committerMark Felder <feld@feld.me>
Mon, 4 Jan 2021 16:13:17 +0000 (10:13 -0600)
Require explicit request to get offset pagination.

lib/pleroma/web/activity_pub/activity_pub.ex
lib/pleroma/web/admin_api/controllers/admin_api_controller.ex

index 15f298bb824e2df77cc2718b3c27888fde2f5679..9db72d6b2bb29e18e219bc2ba03ef6db509f6b29 100644 (file)
@@ -603,11 +603,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do
         |> Map.put(:muting_user, reading_user)
       end
 
-    pagination_type =
-      cond do
-        !Map.has_key?(params, :offset) -> :keyset
-        true -> :offset
-      end
+    pagination_type = Map.get(params, :pagination_type) || :keyset
 
     %{
       godmode: params[:godmode],
index 6ef8d6061a8151c3191c6fdf82756e07d3d122c3..1c7c26d9816b68087bbba50cfb60992e82aab457 100644 (file)
@@ -110,7 +110,8 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIController do
           limit: page_size,
           offset: (page - 1) * page_size,
           godmode: godmode,
-          exclude_reblogs: not with_reblogs
+          exclude_reblogs: not with_reblogs,
+          pagination_type: :offset
         })
 
       conn