|
|
|
@ -87,9 +87,10 @@ class MessagesController < ApplicationController
|
|
|
|
|
@message.save_attachments(params[:attachments])
|
|
|
|
|
if @message.save
|
|
|
|
|
# 更新kindeditor上传的图片资源所有者
|
|
|
|
|
ids = params[:asset_id].split(',')
|
|
|
|
|
update_kindeditor_assets_owner ids,@message.id,OwnerTypeHelper::MESSAGE
|
|
|
|
|
|
|
|
|
|
if params[:asset_id]
|
|
|
|
|
ids = params[:asset_id].split(',')
|
|
|
|
|
update_kindeditor_assets_owner ids,@message.id,OwnerTypeHelper::MESSAGE
|
|
|
|
|
end
|
|
|
|
|
call_hook(:controller_messages_new_after_save, { :params => params, :message => @message})
|
|
|
|
|
render_attachment_warning_if_needed(@message)
|
|
|
|
|
redirect_to board_message_url(@board, @message)
|
|
|
|
@ -121,8 +122,10 @@ class MessagesController < ApplicationController
|
|
|
|
|
@topic.children << @reply
|
|
|
|
|
#@topic.update_attribute(:updated_on, Time.now)
|
|
|
|
|
if !@reply.new_record?
|
|
|
|
|
ids = params[:asset_id].split(',')
|
|
|
|
|
update_kindeditor_assets_owner ids,@reply.id,OwnerTypeHelper::MESSAGE
|
|
|
|
|
if params[:asset_id]
|
|
|
|
|
ids = params[:asset_id].split(',')
|
|
|
|
|
update_kindeditor_assets_owner ids,@reply.id,OwnerTypeHelper::MESSAGE
|
|
|
|
|
end
|
|
|
|
|
call_hook(:controller_messages_reply_after_save, { :params => params, :message => @reply})
|
|
|
|
|
attachments = Attachment.attach_files(@reply, params[:attachments])
|
|
|
|
|
render_attachment_warning_if_needed(@reply)
|
|
|
|
|