summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/models
diff options
context:
space:
mode:
authorSébastien Theys <seb@odoo.com>2020-12-02 14:00:21 +0000
committerSébastien Theys <seb@odoo.com>2020-12-02 14:00:21 +0000
commit8af59b95b477b2eeddec118663e21b00a4e48801 (patch)
treef5d0e5c01de6c26a57fd84543bcfdd60f71346ad /addons/mail/static/src/models
parent209ed7c1991016054cbc4c5fc92ed30a07c4551d (diff)
[FIX] mail: remove html from new message notification
task-2388659 closes odoo/odoo#62442 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/models')
-rw-r--r--addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js b/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js
index 25653ef97e2..b819b031e15 100644
--- a/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js
+++ b/addons/mail/static/src/models/messaging_notification_handler/messaging_notification_handler.js
@@ -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
@@ -759,7 +760,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