diff --git a/clientapp/models/message.js b/clientapp/models/message.js index 4e7c442..e05fb49 100644 --- a/clientapp/models/message.js +++ b/clientapp/models/message.js @@ -238,9 +238,9 @@ var Message = module.exports = HumanModel.define({ }, shouldGroupWith: function (previous) { if (this.type === 'groupchat') { - return previous && previous.from.full === this.from.full; + return previous && previous.from.full === this.from.full && Math.round((this.created - previous.created) / 1000) <= 300 && previous.created.toLocaleDateString() === this.created.toLocaleDateString(); } else { - return previous && previous.from.bare === this.from.bare; + return previous && previous.from.bare === this.from.bare && Math.round((this.created - previous.created) / 1000) <= 300 && previous.created.toLocaleDateString() === this.created.toLocaleDateString(); } } }); diff --git a/clientapp/pages/chat.js b/clientapp/pages/chat.js index 654abb3..e5a060a 100644 --- a/clientapp/pages/chat.js +++ b/clientapp/pages/chat.js @@ -231,9 +231,9 @@ module.exports = BasePage.extend({ } else { newEl = $(model.templateHtml); this.staydown.append(newEl[0]); + this.lastModel = model; } embedIt(newEl); - this.lastModel = model; }, handleAcceptClick: function (e) { e.preventDefault(); diff --git a/clientapp/pages/groupchat.js b/clientapp/pages/groupchat.js index 185d1d4..8c3248e 100644 --- a/clientapp/pages/groupchat.js +++ b/clientapp/pages/groupchat.js @@ -252,9 +252,9 @@ module.exports = BasePage.extend({ } else { newEl = $(model.templateHtml); this.staydown.append(newEl[0]); + this.lastModel = model; } embedIt(newEl); - this.lastModel = model; }, refreshModel: function (model) { var existing = this.$('#chat' + model.cid);