fix(user_msg): cannot open new chat
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Baoshuo Ren 2023-01-16 18:03:09 +08:00
parent da273d1df9
commit bfa0cf8d3d
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A

View File

@ -205,9 +205,11 @@ if (isset($_POST['user_msg'])) {
</script> </script>
<script type="text/javascript"> <script type="text/javascript">
<?php $enter_user = UOJRequest::user(UOJRequest::GET, 'enter'); ?>
var conversations = {}; var conversations = {};
var intervalId = 0; var intervalId = 0;
var user_avatar = '<?= HTML::avatar_addr(Auth::user(), 80) ?>'; var user_avatar = '<?= HTML::avatar_addr(Auth::user(), 80) ?>';
var enter_user = ['<?= $enter_user['username'] ?>', '<?= UOJUser::getRealname($enter_user) ?>', '<?= UOJUser::getUserColor($enter_user) ?>'];
function formatDate(date) { function formatDate(date) {
var d = new Date(date), var d = new Date(date),
@ -309,7 +311,7 @@ if (isset($_POST['user_msg'])) {
function refreshHistory(conversation, page) { function refreshHistory(conversation, page) {
$("#history-list").empty(); $("#history-list").empty();
var ret = false; var ret = false;
$('#conversation-name').html(getUserLink(conversation, conversations[conversation][2], conversations[conversation][3])); $('#conversation-name').html(getUserLink(conversation, conversation == enter_user[0] ? enter_user[1] : conversations[conversation][2], conversation == enter_user[0] ? enter_user[2] : conversations[conversation][3]));
$('#pageShow').text("" + page.toString() + ""); $('#pageShow').text("" + page.toString() + "");
$.get('/user_msg', { $.get('/user_msg', {
getHistory: '', getHistory: '',