Add unread count in window title

The window title now shows the global number of unread messages as
"Signal (1)". This way the user can see the number of unread messages
in the task bar and when alt-tabbing.

Resolves: #384
pull/749/head
ody 10 years ago committed by lilia
parent 8c59862e3d
commit 156c7c3b3d

@ -172,8 +172,6 @@
type : 'incoming'
});
extension.navigator.setBadgeText(newUnreadCount);
return message;
}

@ -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) {

@ -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;

Loading…
Cancel
Save