Commit 78c81007 authored by mgabdev's avatar mgabdev

Updated home_feed.rb as_home_timeline to include max_id

• Updated:
- home_feed.rb as_home_timeline to include max_id
- if no max_id (its the initial page load) then query only between now - 60 days
- else, dont add the date restraint
parent 3c310c45
......@@ -18,7 +18,7 @@ class HomeFeed < Feed
private
def from_database(limit, max_id, since_id, min_id)
Status.as_home_timeline(@account)
Status.as_home_timeline(@account, max_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
......
......@@ -290,14 +290,14 @@ class Status < ApplicationRecord
where(language: nil).or where(language: account.chosen_languages)
end
def as_home_timeline(account)
def as_home_timeline(account, max_id)
query = where(account: [account] + account.following).without_replies
# if account.user.allows_group_in_home_feed?
# query = query.or(where(group: account.groups))
# end
query.where(visibility: [:public, :unlisted, :private])
if max_id.nil?
query.where('updated_at > ?', 60.days.ago)
else
query
end
end
def as_group_timeline(group)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment