summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-06-14 23:51:40 +0200
committerTor Andersson <tor@ccxvii.net>2021-06-14 21:53:42 +0000
commit48aa9edd3a1fbbd405c1001d052b0bbdf46b3de9 (patch)
treecd2f1600bb12bbdf6cf2eb7a21ec674c02031b09
parentbbf77f8d0b06f8f8e8cc0c4c0188e5737d9f6363 (diff)
downloadserver-48aa9edd3a1fbbd405c1001d052b0bbdf46b3de9.tar.gz
Don't leak chat to observers!
-rw-r--r--server.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/server.js b/server.js
index 719b288..9dedb26 100644
--- a/server.js
+++ b/server.js
@@ -827,6 +827,8 @@ function on_resign(socket) {
}
function send_chat(socket, chat) {
+ if (socket.role == "Observer")
+ return;
if (chat && socket.chat_length < chat.length) {
SLOG(socket, "<-- CHAT LOG", socket.chat_length, "..", chat.length);
socket.emit('chat', socket.chat_length, chat.slice(socket.chat_length));