diff options
Diffstat (limited to 'addons/mail/static/src/js/models/threads/document_thread.js')
| -rw-r--r-- | addons/mail/static/src/js/models/threads/document_thread.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/models/threads/document_thread.js b/addons/mail/static/src/js/models/threads/document_thread.js index 283bcf3ca66..f90da991960 100644 --- a/addons/mail/static/src/js/models/threads/document_thread.js +++ b/addons/mail/static/src/js/models/threads/document_thread.js @@ -188,6 +188,10 @@ var DocumentThread = Thread.extend({ * Add this message to this document thread. * * This is ignored if the message is already linked to this document thread. + * Also, there is no fetch of unread message counter in a document thread, + * as this object is built from messages and/or thread field widget. The + * unread counter of a document thread is the sum of needaction messages + * linked to this document thread. * * @override * @private @@ -207,6 +211,10 @@ var DocumentThread = Thread.extend({ if (!_.contains(this._messageIDs, message.getID())) { this._messageIDs.push(message.getID()); } + // update unread counter + if (message.isNeedaction()) { + this._unreadCounter++; + } }, /** * Get most up to date messageIDs |
