diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2017-02-14 19:42:18 +0100 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2017-02-15 09:29:14 +0100 |
| commit | 76e0cb3e9541fbc700ee22881e75d506d99fab78 (patch) | |
| tree | e868786a457443c754b52b86a8822879947c87a7 /addons/mail/static/src/js/chat_manager.js | |
| parent | c1c519a05618ae6b2bdc6e189cfd0a01fab596a4 (diff) | |
[FIX] mail: do not update count if message in no channel
When a message is not part of any channel, the message counter is
incremented while the message won't appear in any channel. This leads to
an inconsistency between the number of messages displayed in the status
bar and the actual messages in Discuss.
opw-706884
Diffstat (limited to 'addons/mail/static/src/js/chat_manager.js')
| -rw-r--r-- | addons/mail/static/src/js/chat_manager.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js index e8dd83d9017..8e0c9b83d7f 100644 --- a/addons/mail/static/src/js/chat_manager.js +++ b/addons/mail/static/src/js/chat_manager.js @@ -479,7 +479,9 @@ function on_needaction_notification (message) { increment_unread: true, }); invalidate_caches(message.channel_ids); - needaction_counter++; + if (message.channel_ids.length !== 0) { + needaction_counter++; + } _.each(message.channel_ids, function (channel_id) { var channel = chat_manager.get_channel(channel_id); if (channel) { |
