From 6aa382f07a75872db327f5f1ed1c012da0d3d5e3 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Fri, 22 Dec 2023 00:23:43 +0100 Subject: Send system chat messages when players join and part active games. --- public/common/client.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'public') diff --git a/public/common/client.js b/public/common/client.js index 23e434d..87dc698 100644 --- a/public/common/client.js +++ b/public/common/client.js @@ -231,7 +231,10 @@ function update_chat(chat_id, raw_date, user, message) { } function add_chat_line(time, user, message) { let line = document.createElement("div") - line.textContent = "[" + time + "] " + user + " \xbb " + message + if (user) + line.textContent = "[" + time + "] " + user + " \xbb " + message + else + line.textContent = "[" + time + "] " + message chat.text_element.appendChild(line) chat.text_element.scrollTop = chat.text_element.scrollHeight } -- cgit v1.2.3