about summary refs log tree commit diff
path: root/app/models/home_feed.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-09-28 02:23:45 +0200
committerGitHub <noreply@github.com>2018-09-28 02:23:45 +0200
commitf0fff3eb1051ff77ec3f37aa75f8c56720b626a3 (patch)
tree7033a49d339bf8ff7ee4c96eb2d27ad40c9f4680 /app/models/home_feed.rb
parent3d7f68c273f03497ff555acac70355ba1815f7a2 (diff)
Support min_id-based pagination in REST API (#8736)
* Allow min_id pagination in Feed#get

* Add min_id pagination to home and list timeline APIs

* Add min_id pagination to account statuses, public and tag APIs

* Remove unused stub in reports API

* Use min_id pagination in notifications, favourites, and fix order

* Fix HomeFeed#from_database not using paginate_by_id
Diffstat (limited to 'app/models/home_feed.rb')
-rw-r--r--app/models/home_feed.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/home_feed.rb b/app/models/home_feed.rb
index b943a34ce..ba7564983 100644
--- a/app/models/home_feed.rb
+++ b/app/models/home_feed.rb
@@ -7,9 +7,9 @@ class HomeFeed < Feed
     @account = account
   end
 
-  def get(limit, max_id = nil, since_id = nil)
+  def get(limit, max_id = nil, since_id = nil, min_id = nil)
     if redis.exists("account:#{@account.id}:regeneration")
-      from_database(limit, max_id, since_id)
+      from_database(limit, max_id, since_id, min_id)
     else
       super
     end
@@ -17,9 +17,9 @@ class HomeFeed < Feed
 
   private
 
-  def from_database(limit, max_id, since_id)
+  def from_database(limit, max_id, since_id, min_id)
     Status.as_home_timeline(@account)
-          .paginate_by_max_id(limit, max_id, since_id)
+          .paginate_by_id(limit, max_id: max_id, since_id: since_id, min_id: min_id)
           .reject { |status| FeedManager.instance.filter?(:home, status, @account.id) }
   end
 end