-//TODO: if new chat fails, do not show chat message locally
-router.post("/chats", access.logged, access.ajax, (req,res) => {
- let gid = ObjectId(req.body.gid);
- let uid = ObjectId(req.body.uid);
- let msg = req.body.msg; //TODO: sanitize HTML (strip all tags...)
- GameModel.addChat(gid, uid, msg, (err,game) => {
- access.checkRequest(res, err, game, "Cannot find game", () => {
- res.json({});
- });
- });
-});
-