From ff56304f58cb8195c9b02bd52f37de0fbee12449 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Thu, 10 Nov 2016 13:12:59 +0100 Subject: [PATCH] [FIX] chat_manager: urls does not render as html link in front-end livechat (opw: 693457) This fix is only intended for saas-12, do not forward port. A better refactoring should be done on master to properly fix this issue --- addons/mail/static/src/js/chat_manager.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js index 9ca3870c7c3..de6fb23018c 100644 --- a/addons/mail/static/src/js/chat_manager.js +++ b/addons/mail/static/src/js/chat_manager.js @@ -659,9 +659,17 @@ var chat_manager = { post_message: function (data, options) { options = options || {}; + + // This message will be received from the mail composer as html content subtype + // but the urls will not be linkified. If the mail composer takes the responsibility + // to linkify the urls we end up with double linkification a bit everywhere. + // Ideally we want to keep the content as text internally and only make html + // enrichment at display time but the current design makes this quite hard to do. + var body = utils.linkify(_.str.trim(data.content)); + var msg = { partner_ids: data.partner_ids, - body: _.str.trim(data.content), + body: body, attachment_ids: data.attachment_ids, }; if ('subject' in data) {