about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-03-12 08:23:03 +0100
committerGitHub <noreply@github.com>2022-03-12 08:23:03 +0100
commitee8d4dd056e883fdfb955e6305e68390a032ac0d (patch)
tree60f240726d7aada9cfa04c7dd9942b8a98fe16dc
parent75e33fd08fb4f926897490b6fa42890b393c0989 (diff)
Fix moderator account leak in status edit history (#17746)
-rw-r--r--app/models/admin/status_batch_action.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/models/admin/status_batch_action.rb b/app/models/admin/status_batch_action.rb
index 4d91b9805..631af183c 100644
--- a/app/models/admin/status_batch_action.rb
+++ b/app/models/admin/status_batch_action.rb
@@ -68,6 +68,8 @@ class Admin::StatusBatchAction
   end
 
   def handle_mark_as_sensitive!
+    representative_account = Account.representative
+
     # Can't use a transaction here because UpdateStatusService queues
     # Sidekiq jobs
     statuses.includes(:media_attachments, :preview_cards).find_each do |status|
@@ -76,7 +78,7 @@ class Admin::StatusBatchAction
       authorize(status, :update?)
 
       if target_account.local?
-        UpdateStatusService.new.call(status, current_account.id, sensitive: true)
+        UpdateStatusService.new.call(status, representative_account.id, sensitive: true)
       else
         status.update(sensitive: true)
       end