[FIX] im_livechat: show the avatar of logged users

Before this commit, the author of the messages in the livechat would
only have an avatar if it was an operator. But logged users would not
have their avatar displayed.

This commit fixes this issue by fetching the avatar when possible.

taskid-3006025

closes odoo/odoo#102739

X-original-commit: 2a5c6c4bc494faecccb86e4b8ad33dab3476b363
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
Thanh Dodeur
2022-10-08 01:53:39 +02:00
parent 3a488d59d4
commit e331c38ee7
@@ -73,8 +73,10 @@ const PublicLivechatMessage = Class.extend({
*/
getAvatarSource() {
let source = this._serverURL;
if (this.hasAuthor()) {
if (this.isOperatorTheAuthor()) {
source += `/im_livechat/operator/${this.getAuthorID()}/avatar`;
} else if (this.hasAuthor() && session.user_id) {
source += `/web/image/res.partner/${this.getAuthorID()}/avatar_128`;
} else {
source += '/mail/static/src/img/smiley/avatar.jpg';
}