X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=inline;f=lib%2Fpleroma%2Fpagination.ex;h=33e45a0eb45b8b83a3a00fae90f22dd562c94ed1;hb=7aebff799b57d27d97f7830fd7c3ef27875c33fe;hp=9a3795769e450e79a52d084b338d9763ec4908e7;hpb=ea2b5c07e32eba6d8a5783fb1a45b79557e1c7b2;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,