about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-02-12 01:38:29 +0100
committerEugen Rochko <eugen@zeonfederated.com>2017-02-12 17:30:15 +0100
commit446267d1bfaba0f596544186361553118615e942 (patch)
tree53eb1cf96a827964728782605238d81e7ef1233c /app
parent78b3b52663a17b9822a857393b5b03f2c1e9587f (diff)
Deduplicate delete salmons (send only one per mentioned-account domain)
Diffstat (limited to 'app')
-rw-r--r--app/services/remove_status_service.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/services/remove_status_service.rb b/app/services/remove_status_service.rb
index b1a646b14..73b545f17 100644
--- a/app/services/remove_status_service.rb
+++ b/app/services/remove_status_service.rb
@@ -32,12 +32,16 @@ class RemoveStatusService < BaseService
   end
 
   def remove_from_mentioned(status)
+    notified_domains = []
+
     status.mentions.each do |mention|
       mentioned_account = mention.account
 
       if mentioned_account.local?
         unpush(:mentions, mentioned_account, status)
       else
+        next if notified_domains.include?(mentioned_account.domain)
+        notified_domains << mentioned_account.domain
         send_delete_salmon(mentioned_account, status)
       end
     end