[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
This commit is contained in:
Nicolas Martinelli
2017-02-15 09:29:14 +01:00
parent c1c519a056
commit 76e0cb3e95
+3 -1
View File
@@ -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) {