diff options
| author | Robot Odoo <xmo+roboto@odoo.com> | 2019-02-15 09:25:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-02-15 09:25:06 +0100 |
| commit | b923ef6c3f45b1bf62ebe8d29b20b936e642f000 (patch) | |
| tree | b633cb8e23428bf12c2d79af9374eb4a678aaf38 /addons/mail/static/src/js/models/threads/dm_chat.js | |
| parent | 9cd8410f693181496dbd946c838c5de4447d0379 (diff) | |
| parent | 8ee218aa5caa6ee10e10e47b80fb384e2e0a7a8b (diff) | |
[MERGE] mail: fix performance issues with channel seen feature
Revision on https://github.com/odoo/odoo/commit/844fb2b51ea7cfa557b19466c0a53dde19433e7a
There were some performance issue with this newly added feature.
This was particularly the case on channels with multiple users, therefore
we have decided to only enable it on direct chats for the moment.
Also, we avoid unnecessary writing in DB and sending notification on longpoll
if the seen information of a user is already up-to-date.
closes odoo/odoo#31074
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 | 4 |
1 files changed, 3 insertions, 1 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 5e69dbeff8c..0f9d3a32294 100644 --- a/addons/mail/static/src/js/models/threads/dm_chat.js +++ b/addons/mail/static/src/js/models/threads/dm_chat.js @@ -1,13 +1,14 @@ odoo.define('mail.model.DMChat', function (require) { "use strict"; +var ChannelSeenMixin = require('mail.model.ChannelSeenMixin'); var TwoUserChannel = require('mail.model.TwoUserChannel'); /** * Any piece of code in JS that make use of DMs must ideally interact with * such objects, instead of direct data from the server. */ -var DMChat = TwoUserChannel.extend({ +var DMChat = TwoUserChannel.extend(ChannelSeenMixin, { /** * @override * @param {Object} params @@ -21,6 +22,7 @@ var DMChat = TwoUserChannel.extend({ */ init: function (params) { this._super.apply(this, arguments); + ChannelSeenMixin.init.apply(this, arguments); var data = params.data; |
