From 9c61f605582520368d61a31e562710f383fab9c1 Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Fri, 9 Feb 2018 21:41:30 +0900 Subject: [PATCH] introduce max_id parameter in feed.atom --- lib/pleroma/web/ostatus/ostatus_controller.ex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/pleroma/web/ostatus/ostatus_controller.ex b/lib/pleroma/web/ostatus/ostatus_controller.ex index d442d16fd..203b6e985 100644 --- a/lib/pleroma/web/ostatus/ostatus_controller.ex +++ b/lib/pleroma/web/ostatus/ostatus_controller.ex @@ -25,6 +25,7 @@ def feed(conn, %{"nickname" => nickname}) do order_by: [desc: :id] activities = query + |> restrict_max(opts) |> Repo.all response = user @@ -54,6 +55,11 @@ defp decode_or_retry(body) do end end + defp restrict_max(query, %{"max_id" => max_id}) do + from activity in query, where: activity.id < ^max_id + end + defp restrict_max(query, _), do: query + def salmon_incoming(conn, _) do {:ok, body, _conn} = read_body(conn) {:ok, doc} = decode_or_retry(body)