summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/chat_manager.js
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2017-02-14 19:42:18 +0100
committerNicolas Martinelli <nim@odoo.com>2017-02-15 09:29:14 +0100
commit76e0cb3e9541fbc700ee22881e75d506d99fab78 (patch)
treee868786a457443c754b52b86a8822879947c87a7 /addons/mail/static/src/js/chat_manager.js
parentc1c519a05618ae6b2bdc6e189cfd0a01fab596a4 (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.js4
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) {