From adb0312faf2bdb6d8d7ffc25204d5ab4084a9bb1 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Tue, 31 Jan 2017 10:00:58 +0100 Subject: [PATCH] [FIX] im_livechat: prefix avatar's src with server url This is required if the livechat is embedded in an external page, so that it can correctly retrieve the images. --- addons/im_livechat/static/src/js/im_livechat.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/im_livechat/static/src/js/im_livechat.js b/addons/im_livechat/static/src/js/im_livechat.js index a7d320c37b1..558fdc14a84 100644 --- a/addons/im_livechat/static/src/js/im_livechat.js +++ b/addons/im_livechat/static/src/js/im_livechat.js @@ -32,6 +32,7 @@ var LivechatButton = Widget.extend({ this.channel = null; this.chat_window = null; this.messages = []; + this.server_url = server_url; }, willStart: function () { @@ -202,10 +203,11 @@ var LivechatButton = Widget.extend({ this.options.default_username; // Compute the avatar_url + msg.avatar_src = this.server_url; if (msg.author_id && msg.author_id[0]) { - msg.avatar_src = "/web/image/res.partner/" + msg.author_id[0] + "/image_small"; + msg.avatar_src += "/web/image/res.partner/" + msg.author_id[0] + "/image_small"; } else { - msg.avatar_src = "/mail/static/src/img/smiley/avatar.jpg"; + msg.avatar_src += "/mail/static/src/img/smiley/avatar.jpg"; } if (options && options.prepend) {