summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/static/src/js')
-rw-r--r--addons/mail/static/src/js/chat_manager.js11
-rw-r--r--addons/mail/static/src/js/window_manager.js2
2 files changed, 8 insertions, 5 deletions
diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js
index d16683d3647..239291628f0 100644
--- a/addons/mail/static/src/js/chat_manager.js
+++ b/addons/mail/static/src/js/chat_manager.js
@@ -200,6 +200,7 @@ function make_channel (data, options) {
autoswitch: 'autoswitch' in options ? options.autoswitch : true,
hidden: options.hidden,
display_needactions: options.display_needactions,
+ mass_mailing: data.mass_mailing,
needaction_counter: data.message_needaction_counter || 0,
unread_counter: data.message_unread_counter || 0,
last_seen_message_id: data.seen_message_id,
@@ -330,10 +331,12 @@ function on_notification (notification) {
function on_needaction_notification (message) {
message = add_message(message, { channel_id: 'channel_inbox', show_notification: true} );
needaction_counter++;
- var channel = chat_manager.get_channel(message.channel_ids[0]);
- if (channel) {
- channel.needaction_counter++;
- }
+ _.each(message.channel_ids, function (channel_id) {
+ var channel = chat_manager.get_channel(channel_id);
+ if (channel) {
+ channel.needaction_counter++;
+ }
+ });
chat_manager.bus.trigger('update_needaction', needaction_counter);
}
diff --git a/addons/mail/static/src/js/window_manager.js b/addons/mail/static/src/js/window_manager.js
index aacf2a2919f..2326ef14dc2 100644
--- a/addons/mail/static/src/js/window_manager.js
+++ b/addons/mail/static/src/js/window_manager.js
@@ -100,7 +100,7 @@ core.bus.on('web_client_ready', null, function () {
chat_manager.bus.on('anyone_listening', null, function (channel, query) {
_.each(chat_sessions, function (session) {
- if (_.contains(channel.id, session.id)) {
+ if (channel.id === session.id) {
query.is_displayed = true;
}
});