diff --git a/js/background.js b/js/background.js index 93cd411ce..f5015fe13 100644 --- a/js/background.js +++ b/js/background.js @@ -172,8 +172,6 @@ type : 'incoming' }); - extension.navigator.setBadgeText(newUnreadCount); - return message; } diff --git a/js/panel_controller.js b/js/panel_controller.js index d1f9239b1..fc6556efb 100644 --- a/js/panel_controller.js +++ b/js/panel_controller.js @@ -9,14 +9,6 @@ window.Whisper = window.Whisper || {}; - window.setUnreadCount = function(count) { - if (count > 0) { - extension.navigator.setBadgeText(count); - } else { - extension.navigator.setBadgeText(""); - } - }; - window.isFocused = function() { return inboxFocused; @@ -79,6 +71,22 @@ } }; + window.setUnreadCount = function(count) { + if (count > 0) { + extension.navigator.setBadgeText(count); + if (inboxOpened === true) { + var appWindow = chrome.app.window.get(inboxWindowId); + appWindow.contentWindow.document.title = "Signal (" + count + ")"; + } + } else { + extension.navigator.setBadgeText(""); + if (inboxOpened === true) { + var appWindow = chrome.app.window.get(inboxWindowId); + appWindow.contentWindow.document.title = "Signal"; + } + } + }; + var open; window.openConversation = function(conversation) { if (inboxOpened === true) { diff --git a/js/views/conversation_view.js b/js/views/conversation_view.js index 39768a2f0..f8dfe7fb3 100644 --- a/js/views/conversation_view.js +++ b/js/views/conversation_view.js @@ -26,7 +26,6 @@ this.listenTo(this.model, 'change:avatar', this.updateAvatar); this.listenTo(this.model, 'change:name', this.updateTitle); this.listenTo(this.model, 'newmessage', this.addMessage); - this.listenTo(this.model, 'change:unreadCount', this.onUnread); this.listenTo(this.model, 'opened', this.onOpened); this.render(); @@ -130,12 +129,6 @@ this.model.markRead(); }, - onUnread: function(model, previous) { - if (!this.isHidden()) { - this.markRead(); - } - }, - verifyIdentity: function() { if (this.model.isPrivate()) { var their_number = this.model.id;