From 7ef9a2fdca7b07a6f7dbd5b71866b4f02476fe04 Mon Sep 17 00:00:00 2001 From: hide_d Date: Tue, 10 Apr 2018 02:51:13 +0900 Subject: [PATCH] =?UTF-8?q?msg=20send=20=EB=B0=98=ED=99=98=20=EB=B0=A9?= =?UTF-8?q?=EC=8B=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/Message.php | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/hwe/sammo/Message.php b/hwe/sammo/Message.php index d9d461cd..2510c77a 100644 --- a/hwe/sammo/Message.php +++ b/hwe/sammo/Message.php @@ -238,7 +238,7 @@ class Message 'option' => $this->msgOption ]) ]); - return $db->insertId(); + return [$mailbox, $db->insertId()]; } protected function sendToSender() : int{ @@ -274,11 +274,24 @@ class Message throw new \RuntimeException('이곳에 올 수 없습니다.'); } - public function send(){ - $sendID = $this->sendToSender(); + public function send():int{ + list($senderMailbox, $sendID) = $this->sendToSender(); if($sendID){ - $this->msgOption['relatedMessageID'] = $sendID; + $this->mailbox = $senderMailbox; + $this->isInboxMail = false; + $this->msgOption['senderMessageID'] = $sendID; + $this->$sendCnt=1; } - $this->sendToReceiver(); + list($receiverMailbox, $receiveID) = $this->sendToReceiver(); + if(!$receiveID){ + $this->id = $sendID; + return $sendID; + } + $this->mailbox = $receiverMailbox; + $this->isInboxMail = true; + $this->id = $receisendID; + $this->$sendCnt=2; + $this->msgOption['receiverMessageID'] = $sendID; + return $receiveID; } }