X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=lib%2Fpleroma%2Fpagination.ex;h=33e45a0eb45b8b83a3a00fae90f22dd562c94ed1;hb=0c2c057c75e21ec411599016b705801f98565cf8;hp=9a3795769e450e79a52d084b338d9763ec4908e7;hpb=61180ab6f4b85ab78de2eaf1bc1b974c9e7908af;p=akkoma diff --git a/lib/pleroma/pagination.ex b/lib/pleroma/pagination.ex index 9a3795769..33e45a0eb 100644 --- a/lib/pleroma/pagination.ex +++ b/lib/pleroma/pagination.ex @@ -1,5 +1,5 @@ # Pleroma: A lightweight social networking server -# Copyright © 2017-2020 Pleroma Authors +# Copyright © 2017-2021 Pleroma Authors # SPDX-License-Identifier: AGPL-3.0-only defmodule Pleroma.Pagination do @@ -93,6 +93,7 @@ defmodule Pleroma.Pagination do max_id: :string, offset: :integer, limit: :integer, + skip_extra_order: :boolean, skip_order: :boolean } @@ -114,6 +115,8 @@ defmodule Pleroma.Pagination do defp restrict(query, :order, %{skip_order: true}, _), do: query + defp restrict(%{order_bys: [_ | _]} = query, :order, %{skip_extra_order: true}, _), do: query + defp restrict(query, :order, %{min_id: _}, table_binding) do order_by( query,