diff --git a/js/conversation_controller.js b/js/conversation_controller.js index 6633e368..efed0e96 100644 --- a/js/conversation_controller.js +++ b/js/conversation_controller.js @@ -30,9 +30,10 @@ updateUnreadCount: function(model, count) { var prev = model.previous('unreadCount') || 0; var newUnreadCount = storage.get("unreadCount", 0) - (prev - count); - setUnreadCount(newUnreadCount); storage.remove("unreadCount"); storage.put("unreadCount", newUnreadCount); + + setUnreadCount(newUnreadCount); } }))(); diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index f8dfe7fb..f9d5c112 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -109,6 +109,10 @@ addMessage: function(message) { this.model.messageCollection.add(message, {merge: true}); + + if (!this.isHidden() && window.isFocused()) { + this.markRead(); + } }, viewMembers: function() {