From e07616e2ef01006077af86377f577226d28f49d0 Mon Sep 17 00:00:00 2001 From: lilia Date: Thu, 4 Aug 2016 15:31:13 -0700 Subject: [PATCH] Only create notifications for unread messages In some cases, we have already received a read receipt for an incoming message by the time we go to create a notification about it. In this case, we should skip the notification. // FREEBIE --- js/models/messages.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/models/messages.js b/js/models/messages.js index 57451d60f..ade716c46 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -357,7 +357,9 @@ message.save().then(function() { conversation.save().then(function() { conversation.trigger('newmessage', message); - conversation.notify(message); + if (message.get('unread')) { + conversation.notify(message); + } resolve(); }); });