diff --git a/party/chat.py b/party/chat.py index 78190f3..e47461d 100644 --- a/party/chat.py +++ b/party/chat.py @@ -16,8 +16,9 @@ class Chat: @classmethod def getAllMessages(self)-> list[dict]: - return list(self.collection.find()) - + messages = self.collection.find() + print(messages) + return list(messages) @classmethod def insertMessage(self, content: str, author: str, timestamp: str): @@ -37,5 +38,6 @@ class Chat: 'author': author, 'timestamp': timestamp, } + print(message) return message diff --git a/party/static/js/chat.js b/party/static/js/chat.js index 5bfea43..a93ae64 100644 --- a/party/static/js/chat.js +++ b/party/static/js/chat.js @@ -6,7 +6,8 @@ function getNChatMessages(socket, count, skip) { data = JSON.parse(data.data.messages) for (let message of data) { - message_array.push(buildChatMessage(message.content, message.author, message.timestamp)); + console.log(message) + message_array.push(buildChatMessage(message.sender, message.text, message.timestamp['$date'])); } const chatBox = document.getElementById('chatBox'); @@ -17,8 +18,8 @@ function getNChatMessages(socket, count, skip) { }); } -function buildChatMessage(content, author, timestap) { - console.log(content, author, timestap); +function buildChatMessage(author, content, timestap) { + //console.log(content, author, timestap); const message = document.createElement('div'); message.classList.add('chat-message'); diff --git a/party/templates/session.html b/party/templates/session.html index 59b6ae9..9a08d95 100644 --- a/party/templates/session.html +++ b/party/templates/session.html @@ -53,20 +53,21 @@
| Event | -Zeit | -Status | -Verwalten | -
| f | -f | -f | -