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
This commit is contained in:
lilia 2016-08-04 15:31:13 -07:00
parent 11e84846bf
commit e07616e2ef

View file

@ -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();
});
});