about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-01-27 15:46:50 +0100
committerThibaut Girka <thib@sitedethib.com>2020-01-27 15:46:50 +0100
commitc56a504d116d62fe669d15a270133d7c78dd61f1 (patch)
tree7400f3182f2a4ebd1606c37a1a5cad4cc95e443b /app/lib
parent8924743349ec5ce37cd949445e071c14968ec2ec (diff)
parentc2dfd5e4e24a70fbfa02678fde4cfc6f6750deb4 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- `app/serializers/rest/account_serializer.rb`:
  Upstream added code too close to glitch-soc-specific followers-hiding code.
  Ported upstream changes.
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/feed_manager.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/lib/feed_manager.rb b/app/lib/feed_manager.rb
index cdb8383df..3ce182809 100644
--- a/app/lib/feed_manager.rb
+++ b/app/lib/feed_manager.rb
@@ -11,6 +11,10 @@ class FeedManager
   # Must be <= MAX_ITEMS or the tracking sets will grow forever
   REBLOG_FALLOFF = 40
 
+  def with_active_accounts(&block)
+    Account.joins(:user).where('users.current_sign_in_at > ?', User::ACTIVE_DURATION.ago).find_each(&block)
+  end
+
   def key(type, id, subtype = nil)
     return "feed:#{type}:#{id}" unless subtype