[FIX] mail: remove html from new message notification

task-2388659

closes odoo/odoo#62756

X-original-commit: 8af59b95b477b2eeddec118663e21b00a4e48801
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Sébastien Theys
2020-12-02 15:51:27 +00:00
parent 03e44752cb
commit 0cf14852a3
@@ -3,6 +3,7 @@ odoo.define('mail/static/src/models/messaging_notification_handler/messaging_not
const { registerNewModel } = require('mail/static/src/model/model_core.js');
const { one2one } = require('mail/static/src/model/model_field.js');
const { htmlToTextContentInline } = require('mail.utils');
const PREVIEW_MSG_MAX_SIZE = 350; // optimal for native English speakers
@@ -748,7 +749,7 @@ function factory(dependencies) {
notificationTitle = owl.utils.escape(authorName);
}
}
const notificationContent = message.prettyBody.substr(0, PREVIEW_MSG_MAX_SIZE);
const notificationContent = htmlToTextContentInline(message.body).substr(0, PREVIEW_MSG_MAX_SIZE);
this.env.services['bus_service'].sendNotification(notificationTitle, notificationContent);
messaging.update({ outOfFocusUnreadMessageCounter: messaging.outOfFocusUnreadMessageCounter + 1 });
const titlePattern = messaging.outOfFocusUnreadMessageCounter === 1