diff options
| author | Alexandre Kühn <aku@odoo.com> | 2019-06-13 13:53:01 +0000 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2019-07-16 14:36:44 +0000 |
| commit | bdf45dca506f9938bfcd3a7acc8757a16d701d05 (patch) | |
| tree | dbe074599045aef04eb18935eef2859d555a14c5 /addons/mail/static/src/js/models/threads/dm_chat.js | |
| parent | 4bde721f925bfe3d1e867565490d3830da150dcc (diff) | |
[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
Diffstat (limited to 'addons/mail/static/src/js/models/threads/dm_chat.js')
| -rw-r--r-- | addons/mail/static/src/js/models/threads/dm_chat.js | 13 |
1 files changed, 13 insertions, 0 deletions
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; |
