commit: 83f27282ba5c40c69cf7945e724685166bb3e5d4
parent afe9c152ab757237313cc15d97855ae39768ddc1
Author: Mark Felder <feld@feld.me>
Date: Mon, 4 Jan 2021 10:13:17 -0600
Do not try to guess which pagination we need by the existence of an :offset param.
Require explicit request to get offset pagination.
Diffstat:
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex
@@ -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],
diff --git a/lib/pleroma/web/admin_api/controllers/admin_api_controller.ex b/lib/pleroma/web/admin_api/controllers/admin_api_controller.ex
@@ -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