]> cat aescling's git repositories - mastodon.git/commitdiff
Fix moderator account leak in status edit history (#17746)
authorEugen Rochko <eugen@zeonfederated.com>
Sat, 12 Mar 2022 07:23:03 +0000 (08:23 +0100)
committerGitHub <noreply@github.com>
Sat, 12 Mar 2022 07:23:03 +0000 (08:23 +0100)
app/models/admin/status_batch_action.rb

index 4d91b98051237cfca0c67d91de22fbeabdd9e2e8..631af183c2ef1e8698b912ca38b5b4468a06d814 100644 (file)
@@ -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