summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/services/mail_window_manager.js
diff options
context:
space:
mode:
authorAlexandre Kühn <aku@odoo.com>2018-08-29 13:23:22 +0200
committerAlexandre Kühn <aku@odoo.com>2018-08-30 13:30:12 +0200
commitf0f81e8db3ea4fb5dc2da453b2973e8bf06df01d (patch)
treec0cfb110e7d6892f0604ae43c4601ab64ce4a55a /addons/mail/static/src/js/services/mail_window_manager.js
parentbe44efe852e96840ff6db139ea66952cbad74e1a (diff)
[FIX] mail: correctly handle (non-)passive thread windows
Definition of '(non-)passive' thread window: Thread windows can be either 'passive' or 'active' (default: 'active'). - When opening a thread window in 'active' mode, the messages are marked as read, and the focus is on the thread window. - When opening a thread window in 'passive' mode, the messages are not marked as read and there is no focus on the thread window. Messages are kept unread until the user interacts with the thread window (e.g. by clicking on composer). When the user intentionally opens a thread window, it should be open in active mode. However, when a thread window is open without any user iteractions, it should open in passive mode. The later case is useful in some cases. For instance, when receiving a new message from a DM conversation, it should automatically open the corresponding thread window. However, it should not automatically mark messages as read. This commit contains 2 bug fixes: 1. When receiving a new message on an active thread window, it no longer increments the unread counter. (When the focus is on the composer of the thread window, the user is immediately reading newly received messages.) 2. When receiving a new message from an unpinned DM conversation, the newly open thread window is always passive. (This was not the case before, so when receiving new messages, it did not increment the unread counter.)
Diffstat (limited to 'addons/mail/static/src/js/services/mail_window_manager.js')
-rw-r--r--addons/mail/static/src/js/services/mail_window_manager.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/mail/static/src/js/services/mail_window_manager.js b/addons/mail/static/src/js/services/mail_window_manager.js
index de614ba705f..79ea668e55e 100644
--- a/addons/mail/static/src/js/services/mail_window_manager.js
+++ b/addons/mail/static/src/js/services/mail_window_manager.js
@@ -641,7 +641,7 @@ MailManager.include({
*/
_onNewChannel: function (channel) {
if (channel.isDetached()) {
- this.openThreadWindow(channel.getID(), { keepFoldState: true });
+ this.openThreadWindow(channel.getID(), { keepFoldState: true, passively: true });
} else {
this._closeThreadWindow(channel.getID());
}