diff options
| author | Aaron Bohy <aab@odoo.com> | 2016-01-14 10:46:40 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2016-01-15 13:18:13 +0100 |
| commit | 617968c61ba6cba243b9907eb9c714032937eaff (patch) | |
| tree | fbac8a46397ce5d6c72f3218fcce88c9c98b7080 /addons/mail/static | |
| parent | 4dd7187a7a26b2676c6debd99f605c0d99420a58 (diff) | |
[FIX] mail: don't mark as unread messages we wrote
in the client action (bold channel name in the sidebar)
in chat windows (number of unread messages written in header)
Diffstat (limited to 'addons/mail/static')
| -rw-r--r-- | addons/mail/static/src/js/chat_manager.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js index 714e38fa157..d4e49760a55 100644 --- a/addons/mail/static/src/js/chat_manager.js +++ b/addons/mail/static/src/js/chat_manager.js @@ -142,17 +142,19 @@ function add_message (data, options) { if (options.domain && options.domain !== []) { add_to_cache(msg, options.domain); } - if (options.increment_unread) { - update_channel_unread_counter(channel, channel.unread_counter+1); - } if (channel.hidden) { channel.hidden = false; chat_manager.bus.trigger('new_channel', channel); } - if (channel.is_chat && options.show_notification && (!msg.author_id || msg.author_id[0] !== session.partner_id)) { - var query = {is_displayed: false}; - chat_manager.bus.trigger('anyone_listening', channel, query); - notify_incoming_message(msg, query); + if (!msg.author_id || msg.author_id[0] !== session.partner_id) { + if (options.increment_unread) { + update_channel_unread_counter(channel, channel.unread_counter+1); + } + if (channel.is_chat && options.show_notification) { + var query = {is_displayed: false}; + chat_manager.bus.trigger('anyone_listening', channel, query); + notify_incoming_message(msg, query); + } } } }); |
