Skip to content
This repository has been archived by the owner on May 16, 2019. It is now read-only.

Commit

Permalink
Revert "Do not trace back timeline"
Browse files Browse the repository at this point in the history
  • Loading branch information
takayamaki authored Apr 27, 2019
1 parent c2b686b commit 4e87010
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
6 changes: 0 additions & 6 deletions app/models/feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ def get(limit, max_id = nil, since_id = nil, min_id = nil)
protected

def from_redis(limit, max_id, since_id, min_id)
# 1ヶ月以上前へ遡ろうとする行為を全面的に禁止
oldest_id = 1.month.ago.to_i * 1000 << 16
max_id = [max_id.to_i, oldest_id].min if max_id.present?
since_id = [since_id.to_i, oldest_id].max if since_id.present?
min_id = [min_id.to_i, oldest_id].max if min_id.present?

if min_id.blank?
max_id = '+inf' if max_id.blank?
since_id = '-inf' if since_id.blank?
Expand Down
6 changes: 0 additions & 6 deletions app/models/home_feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ def get(limit, max_id = nil, since_id = nil, min_id = nil)
private

def from_database(limit, max_id, since_id, min_id)
# 1ヶ月以上前へ遡ろうとする行為を全面的に禁止
oldest_id = 1.month.ago.to_i * 1000 << 16
max_id = [max_id.to_i, oldest_id].min if max_id.present?
since_id = [since_id.to_i, oldest_id].max if since_id.present?
min_id = [min_id.to_i, oldest_id].max if min_id.present?

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) }
Expand Down

0 comments on commit 4e87010

Please sign in to comment.