From 436ff4bef4ac610b3619c449fd2a771554c6e4f1 Mon Sep 17 00:00:00 2001 From: bnu Date: Tue, 19 Nov 2013 22:43:34 +0900 Subject: [PATCH] =?UTF-8?q?#73=20=EC=AA=BD=EC=A7=80=20=EB=B0=9C=EC=86=A1?= =?UTF-8?q?=20=EC=8B=9C=20=ED=8A=B8=EB=A6=AC=EA=B1=B0=20=EC=B6=94=EA=B0=80?= =?UTF-8?q?.=20communicationController::sendMessage()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../communication/communication.controller.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/communication/communication.controller.php b/modules/communication/communication.controller.php index 46ddf4247..ad21e9c09 100644 --- a/modules/communication/communication.controller.php +++ b/modules/communication/communication.controller.php @@ -194,6 +194,16 @@ class communicationController extends communication $receiver_args->readed = 'N'; $receiver_args->regdate = date("YmdHis"); + // Call a trigger (before) + $trigger_obj = new stdClass(); + $trigger_obj->sender = $sender_args; + $trigger_obj->receiver = $receiver_args; + $trigger_output = ModuleHandler::triggerCall('communication.sendMessage', 'before', $trigger_obj); + if(!$trigger_output->toBool()) + { + return $trigger_output; + } + $oDB = DB::getInstance(); $oDB->begin(); @@ -216,6 +226,14 @@ class communicationController extends communication return $output; } + // Call a trigger (after) + $trigger_output = ModuleHandler::triggerCall('communication.sendMessage', 'after', $trigger_obj); + if(!$trigger_output->toBool()) + { + $oDB->rollback(); + return $trigger_output; + } + // create a flag that message is sent (in file format) $flag_path = './files/member_extra_info/new_message_flags/' . getNumberingPath($receiver_srl); FileHandler::makeDir($flag_path);