From 966e611941584120659484e6421dae06b1d525fb Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 27 Sep 2021 11:22:49 +0200 Subject: [PATCH] Find out the mailbox from the rowID --- mail/js/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mail/js/app.js b/mail/js/app.js index f0e3b70ffc..53cf03230c 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -2451,11 +2451,16 @@ app.classes.mail = AppJS.extend( if ((obj_manager && _elems.length>1 && obj_manager.getAllSelected() && !_action.paste) || _action.id=='readall') { try { + let splitedID = []; + let mailbox = ''; // Avoid possibly doing select all action on not desired mailbox e.g. INBOX for (let n=0;n<_elems.length;n++) { + splitedID = _elems[n].id.split("::"); + // find the mailbox from the constructed rowID, sometimes the rowID may not contain the app name + mailbox = splitedID.length == 4?atob(splitedID[2]):atob(splitedID[3]); // 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 (mailbox != tree.getSelectedNode().id.split("::")[1]) return; } }catch(e) {