ActivityPub: restrict_since/restrict_max: ignore empty param
authorhref <href@random.sh>
Tue, 15 Jan 2019 15:39:23 +0000 (16:39 +0100)
committerhref <href@random.sh>
Wed, 23 Jan 2019 10:26:35 +0000 (11:26 +0100)
lib/pleroma/web/activity_pub/activity_pub.ex

index 82fffd324b8cf17f48c8d6ab91997fda0d185de7..85fa83e2b55c0b716dc56ebf44057bdef0fc5bf7 100644 (file)
@@ -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