From: Takeshi Umeda Date: Thu, 23 Jul 2020 13:41:49 +0000 (+0900) Subject: Fix duplicate notification and delivery of mentions (#14378) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=939a47393cf7b65bca9fa7817fcc2dbae770cb9c;p=mastodon.git Fix duplicate notification and delivery of mentions (#14378) --- diff --git a/app/services/process_mentions_service.rb b/app/services/process_mentions_service.rb index 3822b7dc5..79af3fc54 100644 --- a/app/services/process_mentions_service.rb +++ b/app/services/process_mentions_service.rb @@ -36,7 +36,8 @@ class ProcessMentionsService < BaseService next match if mention_undeliverable?(mentioned_account) || mentioned_account&.suspended? - mentions << mentioned_account.mentions.where(status: status).first_or_create(status: status) + mention = mentioned_account.mentions.new(status: status) + mentions << mention if mention.save "@#{mentioned_account.acct}" end