summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/models/threads
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-11-29 20:06:16 +0100
committerChristophe Simonis <chs@odoo.com>2018-11-29 20:06:16 +0100
commitce4cc24621bf6430d7d3a2d469b375b59120c200 (patch)
tree3837b5fe41ff88b24136ab53c871bc01f965cab1 /addons/mail/static/src/js/models/threads
parent4d7aa97da38e497fef31a06543bfa5d2c8785708 (diff)
parent82a1e1dcc33d7c123e50d3e1aacb5e127f57c521 (diff)
[MERGE] forward port branch 12.0 up to 82a1e1dcc33
Diffstat (limited to 'addons/mail/static/src/js/models/threads')
-rw-r--r--addons/mail/static/src/js/models/threads/channel.js12
-rw-r--r--addons/mail/static/src/js/models/threads/mailbox.js21
-rw-r--r--addons/mail/static/src/js/models/threads/multi_user_channel.js10
3 files changed, 32 insertions, 11 deletions
diff --git a/addons/mail/static/src/js/models/threads/channel.js b/addons/mail/static/src/js/models/threads/channel.js
index 808e8b7fbca..ff90ca8edfb 100644
--- a/addons/mail/static/src/js/models/threads/channel.js
+++ b/addons/mail/static/src/js/models/threads/channel.js
@@ -217,21 +217,11 @@ var Channel = SearchableThread.extend(ThreadTypingMixin, {
return _.extend(result, {
author: lastMessage ? lastMessage.getDisplayedAuthor() : '',
body: lastMessage ? mailUtils.parseAndTransform(lastMessage.getBody(), mailUtils.inline) : '',
- date: lastMessage ? lastMessage.getDate() : moment(),
+ date: lastMessage ? lastMessage.getDate() : undefined,
isMyselfAuthor: this.hasMessages() && this.getLastMessage().isMyselfAuthor(),
});
},
/**
- * Returns the title to display in thread window's headers.
- * For channels, the title is prefixed with "#".
- *
- * @override
- * @returns {string|Object} the name of the thread by default (see getName)
- */
- getTitle: function () {
- return "#" + this._super.apply(this, arguments);
- },
- /**
* Get the UUID of the channel.
* This is a string that uniquely links this channel to a server channel.
*
diff --git a/addons/mail/static/src/js/models/threads/mailbox.js b/addons/mail/static/src/js/models/threads/mailbox.js
index 82d65bdd6cc..263072f575e 100644
--- a/addons/mail/static/src/js/models/threads/mailbox.js
+++ b/addons/mail/static/src/js/models/threads/mailbox.js
@@ -189,6 +189,27 @@ var Mailbox = SearchableThread.extend({
throw (_.str(_t("Missing domain for mailbox with ID '%s'"), this._id));
}
},
+ /**
+ * Post a message from inbox. This is used when using the 'reply' feature
+ * on a message that is linked to a document thread.
+ *
+ * @override
+ * @private
+ * @param {Object} messageData
+ * @param {Object} options
+ * @param {integer} options.documentID
+ * @param {string} options.documentModel
+ * @returns {$.Promise}
+ */
+ _postMessage: function (messageData, options) {
+ var documentThread = this.call(
+ 'mail_service',
+ 'getDocumentThread',
+ options.documentModel,
+ options.documentID
+ );
+ return documentThread.postMessage(messageData);
+ },
});
return Mailbox;
diff --git a/addons/mail/static/src/js/models/threads/multi_user_channel.js b/addons/mail/static/src/js/models/threads/multi_user_channel.js
index c1681744127..85d60fc1183 100644
--- a/addons/mail/static/src/js/models/threads/multi_user_channel.js
+++ b/addons/mail/static/src/js/models/threads/multi_user_channel.js
@@ -26,6 +26,16 @@ var MultiUserChannel = Channel.extend({
//--------------------------------------------------------------------------
/**
+ * Returns the title to display in thread window's headers.
+ * For channels, the title is prefixed with "#".
+ *
+ * @override
+ * @returns {string|Object} the name of the thread by default (see getName)
+ */
+ getTitle: function () {
+ return "#" + this._super.apply(this, arguments);
+ },
+ /**
* States whether this thread has the mass mailing setting active or not.
* This is a server-side setting, that determine the type of composer that
* is used (basic or extended composer).