Change media attachments in moderated posts to not be accessible (#34872)

This commit is contained in:
Eugen Rochko 2025-06-12 10:53:02 +02:00 committed by GitHub
commit 24d943fee0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 140 additions and 111 deletions

View file

@ -147,9 +147,13 @@ class RemoveStatusService < BaseService
end
def remove_media
return if @options[:redraft] || !permanently?
return if @options[:redraft]
@status.media_attachments.destroy_all
if permanently?
@status.media_attachments.destroy_all
else
UpdateMediaAttachmentsPermissionsService.new.call(@status.media_attachments, :private)
end
end
def permanently?