Commit 72df048f authored by mgabdev's avatar mgabdev

Updated home_feed.rb as_home_timeline to be date restricted

• Updated:
- home_feed.rb as_home_timeline to be date restricted to only 45 days
parent dce7eb57
......@@ -18,7 +18,7 @@ class HomeFeed < Feed
private
def from_database(limit, max_id, since_id, min_id)
Status.as_home_timeline(@account, max_id)
Status.as_home_timeline(@account)
.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,10 @@ class Status < ApplicationRecord
where(language: nil).or where(language: account.chosen_languages)
end
def as_home_timeline(account, max_id)
def as_home_timeline(account)
query = where(account: [account] + account.following).without_replies
query.where(visibility: [:public, :unlisted, :private])
if max_id.nil?
query.where('updated_at > ?', 60.days.ago)
else
query
end
query.where('updated_at > ?', 45.days.ago)
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