2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-05 08:59:27 +08:00

FEATURE: new 'allow_staff_to_upload_any_file_in_pm' site setting

This commit is contained in:
Régis Hanol 2017-06-12 22:41:29 +02:00
parent 16475bae89
commit 54e8fb0d89
11 changed files with 71 additions and 28 deletions

View file

@ -577,7 +577,7 @@ module Email
# read attachment
File.open(tmp.path, "w+b") { |f| f.write attachment.body.decoded }
# create the upload for the user
opts = { is_attachment_for_group_message: options[:is_group_message] }
opts = { for_group_message: options[:is_group_message] }
upload = UploadCreator.new(tmp, attachment.filename, opts).create_for(options[:user].id)
if upload && upload.errors.empty?
# try to inline images