From: href Date: Tue, 15 Jan 2019 15:39:23 +0000 (+0100) Subject: ActivityPub: restrict_since/restrict_max: ignore empty param X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=cdc5e6ff5ca97f9123998f8af5f7b9d89b485a0c;p=akkoma ActivityPub: restrict_since/restrict_max: ignore empty param --- diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index 82fffd324..85fa83e2b 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -410,6 +410,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do |> Enum.reverse() end + defp restrict_since(query, %{"since_id" => ""}), do: query + defp restrict_since(query, %{"since_id" => since_id}) do from(activity in query, where: activity.id > ^since_id) end @@ -465,6 +467,8 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do defp restrict_local(query, _), do: query + defp restrict_max(query, %{"max_id" => ""}), do: query + defp restrict_max(query, %{"max_id" => max_id}) do from(activity in query, where: activity.id < ^max_id) end