diff options
| author | Alexandre Kühn <aku@odoo.com> | 2020-10-22 13:04:53 +0000 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2020-10-22 13:51:20 +0000 |
| commit | 4ff9ff09193390d9b39b15046855f94a98ad8409 (patch) | |
| tree | 702b14d37f2e3ebfcb89954d65b814f64c745224 /addons/im_livechat/static/src | |
| parent | 8646b0049808036422fec200163a8a4ff1d0df43 (diff) | |
[FIX] im_livechat: visitor sees typing notification of operator
task-2359991
closes odoo/odoo#60535
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Diffstat (limited to 'addons/im_livechat/static/src')
| -rw-r--r-- | addons/im_livechat/static/src/legacy/public_livechat.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/addons/im_livechat/static/src/legacy/public_livechat.js b/addons/im_livechat/static/src/legacy/public_livechat.js index 4dab13c1139..bd9daa6ab5d 100644 --- a/addons/im_livechat/static/src/legacy/public_livechat.js +++ b/addons/im_livechat/static/src/legacy/public_livechat.js @@ -48,6 +48,7 @@ var LivechatButton = Widget.extend({ 'close_chat_window': '_onCloseChatWindow', 'post_message_chat_window': '_onPostMessageChatWindow', 'save_chat_window': '_onSaveChatWindow', + 'updated_typing_partners': '_onUpdatedTypingPartners', 'updated_unread_counter': '_onUpdatedUnreadCounter', }, events: { @@ -187,6 +188,17 @@ var LivechatButton = Widget.extend({ channel_uuid: this._livechat.getUUID(), page_history: history, }); + } else if (notificationData.info === 'typing_status') { + const partnerID = notificationData.partner_id; + if (partnerID === this.options.current_partner_id) { + // ignore typing display of current partner. + return; + } + if (notificationData.is_typing) { + this._livechat.registerTyping({ partnerID }); + } else { + this._livechat.unregisterTyping({ partnerID }); + } } else if ('body' in notificationData) { // normal message // If message from notif is already in chatter messages, stop handling if (this._messages.some(message => message.getID() === notificationData.id)) { @@ -434,6 +446,14 @@ var LivechatButton = Widget.extend({ * @private * @param {OdooEvent} ev */ + _onUpdatedTypingPartners(ev) { + ev.stopPropagation(); + this._chatWindow.renderHeader(); + }, + /** + * @private + * @param {OdooEvent} ev + */ _onUpdatedUnreadCounter: function (ev) { ev.stopPropagation(); this._chatWindow.renderHeader(); |
