From d5886c7507552dc27fde5ab9f8657cf63a96e0ba Mon Sep 17 00:00:00 2001 From: Sebastien Hut Date: Mon, 26 Jan 2015 16:31:32 +0100 Subject: [PATCH] Fix: No notification for old messages --- clientapp/models/muc.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clientapp/models/muc.js b/clientapp/models/muc.js index 3f116b5..03404ac 100644 --- a/clientapp/models/muc.js +++ b/clientapp/models/muc.js @@ -89,7 +89,8 @@ module.exports = HumanModel.define({ message.mentions = this.nick; } - if (notify && (!this.activeContact || (this.activeContact && !app.state.focused)) && !mine) { + var localTime = new Date(); + if (Math.round((localTime - message.created) / 1000) < 5 && notify && (!this.activeContact || (this.activeContact && !app.state.focused)) && !mine) { this.unreadCount++; if (message.mentions) { app.notifications.create(this.displayName, {