about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2020-01-26 20:07:26 +0100
committerGitHub <noreply@github.com>2020-01-26 20:07:26 +0100
commitb9d74d407673a6dbdc87c3310618b22c85358c85 (patch)
treeace3034da9a8d8973ccbbcf3532dee2f597a5364 /app/lib
parent408b3e2b9328f54d471deba346a182f7c8856676 (diff)
Add streaming API updates for announcements being modified or deleted (#12963)
Change `all_day` to be a visual client-side cue only

Publish immediately if `scheduled_at` is in the past

Add `published_at` and `updated_at` to announcements JSON
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 3f167f0d8..13b7aafdf 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