From 4e87010aa84204f9870f83e841305c4e4587da1d Mon Sep 17 00:00:00 2001 From: takayamaki Date: Sun, 28 Apr 2019 01:14:19 +0900 Subject: [PATCH] Revert "Do not trace back timeline" --- app/models/feed.rb | 6 ------ app/models/home_feed.rb | 6 ------ 2 files changed, 12 deletions(-) diff --git a/app/models/feed.rb b/app/models/feed.rb index 492ddc652a4980..5bce88f25522df 100644 --- a/app/models/feed.rb +++ b/app/models/feed.rb @@ -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? diff --git a/app/models/home_feed.rb b/app/models/home_feed.rb index deef3006be5ed9..ba7564983b0f8b 100644 --- a/app/models/home_feed.rb +++ b/app/models/home_feed.rb @@ -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) }