From c7d2f40a7b6fe3e474580a9185d865db6e64b70a Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Fri, 24 Sep 2021 10:23:51 +0200 Subject: [PATCH] Try to avoid running select all action on undesired mailbox --- mail/js/app.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mail/js/app.js b/mail/js/app.js index 08019a8055..565ccdbc8f 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -2445,10 +2445,18 @@ app.classes.mail = AppJS.extend( // we can NOT query global object manager for this.nm_index="nm", as we might not get the one from mail, // if other tabs are open, we have to query for obj_manager for "mail" and then it's child with id "nm" var obj_manager = egw_getObjectManager(this.appname).getObjectById(this.nm_index); + let tree = this.et2.getWidgetById('nm[foldertree]'); var that = this; var rvMain = false; if ((obj_manager && _elems.length>1 && obj_manager.getAllSelected() && !_action.paste) || _action.id=='readall') { + // Avoid possibly doing select all action on not desired mailbox e.g. INBOX + for (let n=0;n<_elems.length;n++) + { + // drop the action if there's a mixedup mailbox found in the selected messages + if (atob(_elems[n].id.split("::")[3]) != tree.getSelectedNode().id.split("::")[1]) return; + } + if (_confirm) { var buttons = [