forked from treehouse/mastodon
Fix moderator account leak in status edit history (#17746)
parent
75e33fd08f
commit
ee8d4dd056
|
@ -68,6 +68,8 @@ class Admin::StatusBatchAction
|
||||||
end
|
end
|
||||||
|
|
||||||
def handle_mark_as_sensitive!
|
def handle_mark_as_sensitive!
|
||||||
|
representative_account = Account.representative
|
||||||
|
|
||||||
# Can't use a transaction here because UpdateStatusService queues
|
# Can't use a transaction here because UpdateStatusService queues
|
||||||
# Sidekiq jobs
|
# Sidekiq jobs
|
||||||
statuses.includes(:media_attachments, :preview_cards).find_each do |status|
|
statuses.includes(:media_attachments, :preview_cards).find_each do |status|
|
||||||
|
@ -76,7 +78,7 @@ class Admin::StatusBatchAction
|
||||||
authorize(status, :update?)
|
authorize(status, :update?)
|
||||||
|
|
||||||
if target_account.local?
|
if target_account.local?
|
||||||
UpdateStatusService.new.call(status, current_account.id, sensitive: true)
|
UpdateStatusService.new.call(status, representative_account.id, sensitive: true)
|
||||||
else
|
else
|
||||||
status.update(sensitive: true)
|
status.update(sensitive: true)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue