ActivityPub: restrict_since/restrict_max: ignore empty param

This commit is contained in:
href 2019-01-15 16:39:23 +01:00
parent 6e3091740b
commit 9bb627a1a1
No known key found for this signature in database
GPG Key ID: EE8296C1A152C325
1 changed files with 4 additions and 0 deletions

View File

@ -407,6 +407,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
@ -462,6 +464,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