about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-10-30 15:03:55 +0100
committerGitHub <noreply@github.com>2018-10-30 15:03:55 +0100
commitbe202f9377fecfc801befac0be6d11d9f0039c5d (patch)
tree0069e37db8bfebc5475c5627c700251ad60d9210 /app/services
parent47b8d195e6ea5bc5f3cd4fe3a5be0b25ec322f10 (diff)
Accept the same payload in multiple inboxes and deliver (#9150)
Diffstat (limited to 'app/services')
-rw-r--r--app/services/fan_out_on_write_service.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/app/services/fan_out_on_write_service.rb b/app/services/fan_out_on_write_service.rb
index 7f2a91775..f3e9c855d 100644
--- a/app/services/fan_out_on_write_service.rb
+++ b/app/services/fan_out_on_write_service.rb
@@ -58,10 +58,8 @@ class FanOutOnWriteService < BaseService
   def deliver_to_mentioned_followers(status)
     Rails.logger.debug "Delivering status #{status.id} to limited followers"
 
-    status.mentions.includes(:account).each do |mention|
-      mentioned_account = mention.account
-      next if !mentioned_account.local? || !mentioned_account.following?(status.account) || FeedManager.instance.filter?(:home, status, mention.account_id)
-      FeedManager.instance.push_to_home(mentioned_account, status)
+    FeedInsertWorker.push_bulk(status.mentions.includes(:account).map(&:account).select { |mentioned_account| mentioned_account.local? && mentioned_account.following?(status.account) }) do |follower|
+      [status.id, follower.id, :home]
     end
   end