- on popup chat, point on end line for see if you have seen the last message
    - on chat buttton, red point for know if you have a new message
    - fix image in live chat
This commit is contained in:
Kum1ta
2024-09-29 03:52:10 +02:00
parent 4ef459e2cc
commit 24fe748130
8 changed files with 104 additions and 48 deletions

View File

@ -6,30 +6,33 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/04 19:17:54 by edbernar #+# #+# */
/* Updated: 2024/09/22 17:16:00 by edbernar ### ########.fr */
/* Updated: 2024/09/29 03:46:37 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
import { messageList, infoPanel, waitForMessageList } from "/static/javascript/typeResponse/typePrivateListMessage.js";
import { userListUnread } from "/static/javascript/typeResponse/typePrivateListUser.js";
import { userMeInfo } from "/static/javascript/typeResponse/typeLogin.js";
import { showListUser } from "/static/javascript/liveChat/showUserList.js";
import { sendRequest } from "/static/javascript/websocket.js";
let savedButtons = [];
function showPrivateChat(user)
{
const divMessageListChatHome = document.getElementById("messageListChatHome");
sendRequest("get_private_list_message", {id: user.id});
waitForMessageList().then(() => {
try {
userListUnread.splice(userListUnread.indexOf(user.id), 1);
}
catch (e) {};
infoPanel.id = user.id;
infoPanel.isOpen = true;
infoPanel.divMessage = divMessageListChatHome;
sendRequest("read_message", {id: user.id});
changeButton(user);
displayAllMessage(divMessageListChatHome);
displayInputBar(divMessageListChatHome, user);
})
}