From 856743fd063d0da1369c1bd0452390001926a422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Fri, 13 Nov 2015 11:13:07 +0100 Subject: [PATCH] [FIX] mail: automatically join a channel if a message is received before, messages were ignored if we were not already in the channel. --- addons/mail/static/src/js/chat_manager.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/mail/static/src/js/chat_manager.js b/addons/mail/static/src/js/chat_manager.js index e5913f4232b..e25016a980a 100644 --- a/addons/mail/static/src/js/chat_manager.js +++ b/addons/mail/static/src/js/chat_manager.js @@ -339,6 +339,10 @@ function on_channel_notification (message) { if (channel) { channel.unread_counter++; add_message(message, { channel_id: channel.id, show_notification: true }); + } else { + chat_manager.join_channel(message.channel_ids[0], {autoswitch: false}).then(function() { + add_message(message, { channel_id: message.channel_ids[0], show_notification: true }); + }); } } @@ -413,7 +417,7 @@ function on_mark_as_unread_notification (data) { function on_chat_session_notification (chat_session) { if ((chat_session.channel_type === "channel") && (chat_session.public === "private") && (chat_session.state === "open")) { - add_channel(chat_session, {autoswitch: false}); + add_channel(chat_session, {autoswitch: false, silent: true, hidden: true}); if (!chat_session.is_minimized) { web_client.do_notify(_t("Private Channel"), _t("You have been invited to: ") + chat_session.name); }