summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/services/mail_notification_manager.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/static/src/js/services/mail_notification_manager.js')
-rw-r--r--addons/mail/static/src/js/services/mail_notification_manager.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/addons/mail/static/src/js/services/mail_notification_manager.js b/addons/mail/static/src/js/services/mail_notification_manager.js
index 9cef9742747..ba9230eb32b 100644
--- a/addons/mail/static/src/js/services/mail_notification_manager.js
+++ b/addons/mail/static/src/js/services/mail_notification_manager.js
@@ -97,9 +97,14 @@ MailManager.include({
_handleChannelMessageNotification: function (messageData) {
var self = this;
var def;
- var channelAlreadyInCache = true;
+ let notify = true;
if (messageData.channel_ids.length === 1) {
- channelAlreadyInCache = !!this.getChannel(messageData.channel_ids[0]);
+ const channel = this.getChannel(messageData.channel_ids[0]);
+ // Message from mailing channel should not make a notification in Odoo for users
+ // with notification "Handled by Email", but web client should receive the message.
+ // Channel has been marked as read server-side in this case, so it should not display
+ // a notification by incrementing the unread counter.
+ notify = channel && (!channel.isMassMailing() || session.notification_type !== 'email');
def = this.joinChannel(messageData.channel_ids[0], { autoswitch: false });
} else {
def = Promise.resolve();
@@ -109,7 +114,7 @@ MailManager.include({
// its unread counter has just been fetched
return self.addMessage(messageData, {
showNotification: true,
- incrementUnread: channelAlreadyInCache
+ incrementUnread: notify,
});
});
},