From 0d6d20b939391a5a3eca29cd2e13c7319834e3c0 Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Sun, 3 Nov 2013 23:39:09 -0800 Subject: [PATCH] [#1740] temp workaround to chat duplication --- src/controllers/groups.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/controllers/groups.js b/src/controllers/groups.js index a6d4b350a5..8d16812b00 100644 --- a/src/controllers/groups.js +++ b/src/controllers/groups.js @@ -210,6 +210,9 @@ api.postChat = function(req, res, next) { timestamp: +(new Date) }; + // workaround for preventing duplicate chat messages. Real solution is to prevent between sends on the client + if (group.chat[0].uuid == message.uuid && group.chat[0].text == message.text) return res.json(group); + group.chat.unshift(message); group.chat.splice(200);