about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2020-07-23 22:41:49 +0900
committerGitHub <noreply@github.com>2020-07-23 15:41:49 +0200
commit939a47393cf7b65bca9fa7817fcc2dbae770cb9c (patch)
treefbefc83efa49567bf7abe5396c2be760d6a3697b /app
parentd5d856f104f2973d1b4a87770c23a158f1f69835 (diff)
Fix duplicate notification and delivery of mentions (#14378)
Diffstat (limited to 'app')
-rw-r--r--app/services/process_mentions_service.rb3
1 files changed, 2 insertions, 1 deletions
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