diff --git a/web/app/controllers/user_msg.php b/web/app/controllers/user_msg.php index 0ec5740..8397ee6 100644 --- a/web/app/controllers/user_msg.php +++ b/web/app/controllers/user_msg.php @@ -49,11 +49,11 @@ function getConversations() { continue; } - $ret[$msg['sender']] = [$msg['send_time'], ($msg['read_time'] == null)]; + $ret[$msg['sender']] = [$msg['send_time'], ($msg['read_time'] == null), $msg['message']]; } else { if (isset($ret[$msg['receiver']])) continue; - $ret[$msg['receiver']] = [$msg['send_time'], 0]; + $ret[$msg['receiver']] = [$msg['send_time'], 0, $msg['message']]; } } $res = []; @@ -66,6 +66,7 @@ function getConversations() { HTML::avatar_addr($user, 128), UOJUser::getRealname($user), UOJUser::getUserColor($user), + $con[2], ]; } @@ -232,7 +233,7 @@ if (isset($_POST['user_msg'])) { return [hour, minute].join(':'); } - function addButton(conversationName, send_time, type, avatar_addr, realname, color) { + function addButton(conversationName, send_time, type, avatar_addr, realname, color, last_message) { var now = new Date(); var time = new Date(send_time); var timeStr = formatDate(send_time); @@ -242,17 +243,22 @@ if (isset($_POST['user_msg'])) { } $("#conversations").append( - '