addHistory(), addNationHistory()에서 history를 덧붙이는 과정 개선
This commit is contained in:
+13
-1
@@ -44,7 +44,15 @@ class Message{
|
||||
}
|
||||
}
|
||||
|
||||
function getSingleMessage($messageID){
|
||||
$messageInfo = getDB()->queryFirstRow('select * from `message` where `id` = %i', $messageID);
|
||||
|
||||
if (!$messageInfo) {
|
||||
return [false, '존재하지 않는 메시지'];
|
||||
}
|
||||
|
||||
return [true, $messageInfo];
|
||||
}
|
||||
|
||||
function getRawMessage($mailbox, $msgType, $limit=30, $fromSeq=NULL){
|
||||
|
||||
@@ -114,13 +122,17 @@ function sendRawMessage($msgType, $isSender, $mailbox, $src, $dest, $msg, $date,
|
||||
$dest['nation'] = util::array_get($destNation['name'], '재야');
|
||||
$dest['color'] = util::array_get($destNation['color'], '#ffffff');
|
||||
|
||||
if(!$isSender && $mailBox < 9000){
|
||||
if(!$isSender && $mailBox < 9000 && util::array_get($msgOption['alert'], false)){
|
||||
//TODO:newmsg보단 lastmsg로 datetime을 넣는게 더 나아보임
|
||||
getDB()->update('general', array(
|
||||
'newmsg' => true
|
||||
), 'no=%i', $dest['id']);
|
||||
}
|
||||
|
||||
if(isset($msgOption['alert'])){
|
||||
unset($msgOption['alert']);
|
||||
}
|
||||
|
||||
getDB()->insert('message', array(
|
||||
'address' => $dest,
|
||||
'type' => $msgType,
|
||||
|
||||
Reference in New Issue
Block a user