From bdf45dca506f9938bfcd3a7acc8757a16d701d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Thu, 13 Jun 2019 13:53:01 +0000 Subject: [FIX] mail: auto-update out-of-office info on im_status change Before this commit, chat window's out-of-office info did not change when direct partner's `im_status` is/was on 'leave'. Users had to reload page to see updated out-of-office info. Task-ID 2007663 --- addons/mail/static/src/js/models/threads/dm_chat.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'addons/mail/static/src/js/models/threads/dm_chat.js') diff --git a/addons/mail/static/src/js/models/threads/dm_chat.js b/addons/mail/static/src/js/models/threads/dm_chat.js index c0ba9c527b0..78cc01a7044 100644 --- a/addons/mail/static/src/js/models/threads/dm_chat.js +++ b/addons/mail/static/src/js/models/threads/dm_chat.js @@ -101,6 +101,19 @@ var DMChat = TwoUserChannel.extend(ChannelSeenMixin, { getStatus: function () { return this.call('mail_service', 'getImStatus', { partnerID: this._directPartnerID }); }, + + /** + * @param {Object} data + * @param {string} data.outOfOfficeMessage + * @param {string} data.outOfOfficeDateEnd + */ + updateOutOfOfficeInfo: function (data) { + this._outOfOfficeMessage = data.outOfOfficeMessage; + this._outOfOfficeDateEnd = data.outOfOfficeDateEnd; + this.call('mail_service', 'getMailBus').trigger('updated_out_of_office', { + threadID: this.getID(), + }); + } }); return DMChat; -- cgit v1.2.3