diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-04-12 17:11:01 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-04-12 17:12:00 +0200 |
commit | b666f11d2fc32b10dce0d36e72cc285377c28f18 (patch) | |
tree | b60ad84243b6d04227a5377f24f960333ea16758 /lib | |
parent | 6a179a44bec113b8fb9a8092f791111a318e7a53 (diff) | |
download | pleroma-b666f11d2fc32b10dce0d36e72cc285377c28f18.tar.gz |
Add max_id fetching to activity fetching.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/activity_pub.ex | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index ec9c5e970..75e4101f2 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -54,6 +54,12 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do query = from activity in query, where: activity.id > ^since_id + query = if opts["max_id"] do + from activity in query, where: activity.id < ^opts["max_id"] + else + query + end + Repo.all(query) |> Enum.reverse end |