From: Mark Felder Date: Mon, 4 Jan 2021 16:13:17 +0000 (-0600) Subject: Do not try to guess which pagination we need by the existence of an :offset param. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=83f27282ba5c40c69cf7945e724685166bb3e5d4;p=akkoma Do not try to guess which pagination we need by the existence of an :offset param. Require explicit request to get offset pagination. --- diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 15f298bb8..9db72d6b2 100644 --- 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 index 6ef8d6061..1c7c26d98 100644 --- 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