projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix chat issues when launching a game
[vchess.git]
/
server
/
sockets.js
diff --git
a/server/sockets.js
b/server/sockets.js
index
891c516
..
3b16653
100644
(file)
--- a/
server/sockets.js
+++ b/
server/sockets.js
@@
-110,7
+110,9
@@
module.exports = function(wss) {
}
break;
case "newchat":
}
break;
case "newchat":
- notifyRoom(query["page"], "newchat", {msg:obj.msg, name:obj.name});
+ // WARNING: do not use query["page"], because the page may change
+ notifyRoom(clients[sid].page, "newchat",
+ {msg: obj.msg, name: obj.name});
break;
// TODO: WebRTC instead in this case (most demanding?)
case "newmove":
break;
// TODO: WebRTC instead in this case (most demanding?)
case "newmove":