From c21d200285ebeb646b8e5be6ba233f96d9714c6f Mon Sep 17 00:00:00 2001 From: XavierDo Date: Mon, 7 Jan 2019 12:31:18 +0000 Subject: [IMP] mail: add ooo status in chats windows. In a chat window with a single usert (dm_chat) the ooo status of the other user is displayed on the top when set. Task: 1856205 --- addons/mail/static/src/js/models/threads/dm_chat.js | 14 ++++++++++++++ 1 file changed, 14 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 4967a1e9963..21fb72e91ae 100644 --- a/addons/mail/static/src/js/models/threads/dm_chat.js +++ b/addons/mail/static/src/js/models/threads/dm_chat.js @@ -1,7 +1,9 @@ odoo.define('mail.model.DMChat', function (require) { "use strict"; +var core = require('web.core'); var TwoUserChannel = require('mail.model.TwoUserChannel'); +var _t = core._t; /** * Any piece of code in JS that make use of DMs must ideally interact with @@ -18,6 +20,7 @@ var DMChat = TwoUserChannel.extend({ * @param {integer} params.data.direct_partner[0].id * @param {string} params.data.direct_partner[0].im_status * @param {string} params.data.direct_partner[0].name + * @param {string} [params.data.direct_partner[0].out_of_office_message=''] */ init: function (params) { this._super.apply(this, arguments); @@ -50,6 +53,17 @@ var DMChat = TwoUserChannel.extend({ getDirectPartnerID: function () { return this._directPartnerID; }, + /** + * Get the out of office message of the thread + * + * @returns {string} + */ + getOutOfOfficeMessage: function () { + if (this._outOfOfficeMessage === '') { + return undefined; + } + return this._outOfOfficeMessage; + }, /** * @override */ -- cgit v1.2.3