From 1a6cedac5629c015a5e0eca3b62bbb9ea9a84f98 Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Wed, 25 Nov 2015 23:03:53 +0100 Subject: [PATCH] Fix #402 Remove messages which are read from the notification --- js/models/conversations.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/models/conversations.js b/js/models/conversations.js index cbb03f13..0fdc1df5 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -175,6 +175,12 @@ markRead: function() { if (this.get('unreadCount') > 0) { this.save({unreadCount: 0}); + var conversationId = this.id; + Whisper.Notifications.remove( + Whisper.Notifications.models.filter( + function(model){ + return model.attributes.conversationId===conversationId; + })); } },