From: Eugen Rochko Date: Sun, 12 Feb 2017 00:38:29 +0000 (+0100) Subject: Deduplicate delete salmons (send only one per mentioned-account domain) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=446267d1bfaba0f596544186361553118615e942;p=mastodon.git Deduplicate delete salmons (send only one per mentioned-account domain) --- 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