about summary refs log tree commit diff
path: root/app/services/fan_out_on_write_service.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-02-12 11:12:41 +0100
committerClaire <claire.github-309c@sitedethib.com>2022-02-12 11:12:41 +0100
commitd9379f53312f1bee490afb0fd7dc368df1a4a96d (patch)
tree1decb10519ec165483b735095e92ab2e94c2d080 /app/services/fan_out_on_write_service.rb
parent28ec7def5869ff1a85f49a070b9575c166a432ee (diff)
parent79b167f01a91f79d92afb442de282ded8696066a (diff)
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/services/fan_out_on_write_service.rb')
-rw-r--r--app/services/fan_out_on_write_service.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb
index 46feec5aa..08fae7935 100644
--- a/app/services/fan_out_on_write_service.rb
+++ b/app/services/fan_out_on_write_service.rb
@@ -34,6 +34,7 @@ class FanOutOnWriteService < BaseService
   def fan_out_to_local_recipients!
     deliver_to_self!
     notify_mentioned_accounts!
+    notify_about_update! if update?
 
     case @status.visibility.to_sym
     when :public, :unlisted, :private
@@ -66,6 +67,14 @@ class FanOutOnWriteService < BaseService
     end
   end
 
+  def notify_about_update!
+    @status.reblogged_by_accounts.merge(Account.local).select(:id).reorder(nil).find_in_batches do |accounts|
+      LocalNotificationWorker.push_bulk(accounts) do |account|
+        [account.id, @status.id, 'Status', 'update']
+      end
+    end
+  end
+
   def deliver_to_all_followers!
     @account.followers_for_local_distribution.select(:id).reorder(nil).find_in_batches do |followers|
       FeedInsertWorker.push_bulk(followers) do |follower|