Fix: No notification for old messages

This commit is contained in:
Sebastien Hut 2015-01-26 16:31:32 +01:00
parent e312e7bd99
commit d5886c7507
1 changed files with 2 additions and 1 deletions

View File

@ -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, {