[FIX] im_livechat: properly display operator avatar in posted message

Before this commit, avatar of operator was not displayed properly.
This is due to src of avatar being wrongly computed: the serverUrl
data is in `PublicLivechatGlobal`, not in `LivechatButtonView`.

Because of this, the src was prefixed with `undefined/` instead
of the server url, hence no displaying the avatar of operator.

This commit fixes issue by getting actual `serverUrl` in correct
model `PublicLivechatGlobal`.

closes odoo/odoo#99022

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Alexandre Kühn
2022-08-27 05:25:53 +02:00
parent 0d06e5aae8
commit b8f0ccf6ed
@@ -41,7 +41,7 @@ const PublicLivechatMessage = Class.extend({
this._type = data.message_type || undefined;
this._defaultUsername = this.messaging.publicLivechatGlobal.options.default_username;
this._serverURL = this.messaging.publicLivechatGlobal.livechatButtonView.serverUrl;
this._serverURL = this.messaging.publicLivechatGlobal.serverUrl;
if (parent.messaging.publicLivechatGlobal.livechatButtonView.isChatbot) {
this._chatbotStepId = data.chatbot_script_step_id;