[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.
This commit is contained in:
Aaron Bohy
2017-01-31 10:15:32 +01:00
parent 3f7c25da24
commit adb0312faf
@@ -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) {