Change media attachments in moderated posts to not be accessible (#34872)
This commit is contained in:
parent
d1fb957361
commit
24d943fee0
13 changed files with 140 additions and 111 deletions
|
|
@ -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?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue