The code powering m.abunchtell.com https://m.abunchtell.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

26 lines
590 B

  1. # frozen_string_literal: true
  2. class HomeFeed < Feed
  3. def initialize(account)
  4. @type = :home
  5. @id = account.id
  6. @account = account
  7. end
  8. def get(limit, max_id = nil, since_id = nil)
  9. if redis.exists("account:#{@account.id}:regeneration")
  10. from_database(limit, max_id, since_id)
  11. else
  12. super
  13. end
  14. end
  15. private
  16. def from_database(limit, max_id, since_id)
  17. Status.as_home_timeline(@account)
  18. .paginate_by_max_id(limit, max_id, since_id)
  19. .reject { |status| FeedManager.instance.filter?(:home, status, @account.id) }
  20. end
  21. end