Quiet notifications if the window is open
Draw attention to the window instead. // FREEBIE
This commit is contained in:
@@ -86,11 +86,10 @@
|
|||||||
|
|
||||||
window.notifyConversation = function(message) {
|
window.notifyConversation = function(message) {
|
||||||
var conversationId = message.get('conversationId');
|
var conversationId = message.get('conversationId');
|
||||||
var windowId = windowMap.windowIdFrom(conversationId);
|
if (inboxOpened) {
|
||||||
if (windowId) {
|
|
||||||
// already open
|
// already open
|
||||||
updateConversation(conversationId);
|
updateConversation(conversationId);
|
||||||
extension.windows.drawAttention(windowId);
|
extension.windows.drawAttention(inboxWindowId);
|
||||||
} else if (Whisper.Notifications.isEnabled()) {
|
} else if (Whisper.Notifications.isEnabled()) {
|
||||||
var conversation = getConversation({id: message.get('conversationId')});
|
var conversation = getConversation({id: message.get('conversationId')});
|
||||||
var sender = getConversation({id: message.get('source')});
|
var sender = getConversation({id: message.get('source')});
|
||||||
@@ -109,6 +108,7 @@
|
|||||||
conversation.fetchMessages();
|
conversation.fetchMessages();
|
||||||
} else {
|
} else {
|
||||||
openConversation(conversationId);
|
openConversation(conversationId);
|
||||||
|
openInbox();
|
||||||
extension.windows.drawAttention(windowId);
|
extension.windows.drawAttention(windowId);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user