mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-24 19:23:41 +01:00
Deduplicate delete salmons (send only one per mentioned-account domain)
This commit is contained in:
parent
78b3b52663
commit
446267d1bf
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue