logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma
commit: 381ba256bf9341eb70d03988bf3a31c3fcd7b9a5
parent: 1a947042300045cadc62ea1153a75129f5282281
Author: William Pitcock <nenolod@dereferenced.org>
Date:   Thu, 22 Mar 2018 04:47:18 +0000

activitypub: add restrict_limit

Diffstat:

Mlib/pleroma/web/activity_pub/activity_pub.ex7+++++++
1 file changed, 7 insertions(+), 0 deletions(-)

diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -185,6 +185,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do or_where: activity.actor == ^user.ap_id end + defp restrict_limit(query, %{"limit" => limit}) do + from activity in query, + limit: ^limit + end + defp restrict_limit(query, _), do: query + defp restrict_local(query, %{"local_only" => true}) do from activity in query, where: activity.local == true end @@ -248,6 +254,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do |> restrict_tag(opts) |> restrict_since(opts) |> restrict_local(opts) + |> restrict_limit(opts) |> restrict_max(opts) |> restrict_actor(opts) |> restrict_type(opts)