about summary refs log tree commit diff
path: root/app/services/delete_account_service.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/services/delete_account_service.rb')
-rw-r--r--app/services/delete_account_service.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/services/delete_account_service.rb b/app/services/delete_account_service.rb
index 2bb533cfb..802799ccd 100644
--- a/app/services/delete_account_service.rb
+++ b/app/services/delete_account_service.rb
@@ -142,6 +142,7 @@ class DeleteAccountService < BaseService
     purge_user!
     purge_profile!
     purge_statuses!
+    purge_mentions!
     purge_media_attachments!
     purge_polls!
     purge_generated_notifications!
@@ -159,6 +160,10 @@ class DeleteAccountService < BaseService
     end
   end
 
+  def purge_mentions!
+    @account.mentions.reorder(nil).where.not(status_id: reported_status_ids).in_batches.delete_all
+  end
+
   def purge_media_attachments!
     @account.media_attachments.reorder(nil).find_each do |media_attachment|
       next if keep_account_record? && reported_status_ids.include?(media_attachment.status_id)
@@ -182,7 +187,7 @@ class DeleteAccountService < BaseService
     @account.favourites.in_batches do |favourites|
       ids = favourites.pluck(:status_id)
       StatusStat.where(status_id: ids).update_all('favourites_count = GREATEST(0, favourites_count - 1)')
-      Chewy.strategy.current.update(StatusesIndex, ids) if Chewy.enabled?
+      Chewy.strategy.current.update(StatusesIndex::Status, ids) if Chewy.enabled?
       # Rails.cache.delete_multi would be better, but we don't have it yet
       ids.each { |id| Rails.cache.delete("statuses/#{id}") }
       favourites.delete_all
@@ -191,7 +196,7 @@ class DeleteAccountService < BaseService
 
   def purge_bookmarks!
     @account.bookmarks.in_batches do |bookmarks|
-      Chewy.strategy.current.update(StatusesIndex, bookmarks.pluck(:status_id)) if Chewy.enabled?
+      Chewy.strategy.current.update(StatusesIndex::Status, bookmarks.pluck(:status_id)) if Chewy.enabled?
       bookmarks.delete_all
     end
   end