From eb802135a9e122cdfcc19f1466c5d7f6ffadc7c6 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Sun, 26 Nov 2023 17:52:20 +0100 Subject: [PATCH] Add folder full name to message uids set --- dev/Stores/User/Messagelist.js | 1 + dev/View/User/MailBox/FolderList.js | 7 ++++--- dev/View/User/MailBox/MessageList.js | 12 +++++++----- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/dev/Stores/User/Messagelist.js b/dev/Stores/User/Messagelist.js index 42ebda1e8..b160626b1 100644 --- a/dev/Stores/User/Messagelist.js +++ b/dev/Stores/User/Messagelist.js @@ -114,6 +114,7 @@ addComputablesTo(MessagelistUserStore, { let result = new Set; MessagelistUserStore.listCheckedOrSelected().forEach(message => { result.add(message.uid); + result.folder = message.folder; if (1 < message.threadsLen()) { message.threads().forEach(result.add, result); } diff --git a/dev/View/User/MailBox/FolderList.js b/dev/View/User/MailBox/FolderList.js index de8685829..f9b5b50ed 100644 --- a/dev/View/User/MailBox/FolderList.js +++ b/dev/View/User/MailBox/FolderList.js @@ -91,9 +91,10 @@ export class MailFolderList extends AbstractViewLeft { if (folder) { if (moveAction()) { moveAction(false); - MessagelistUserStore.moveMessages( - FolderUserStore.currentFolderFullName(), - MessagelistUserStore.listCheckedOrSelectedUidsWithSubMails(), + let messages = MessagelistUserStore.listCheckedOrSelectedUidsWithSubMails(); + messages.size && MessagelistUserStore.moveMessages( + messages.folder, + messages, folder.fullName, event.ctrlKey ); diff --git a/dev/View/User/MailBox/MessageList.js b/dev/View/User/MailBox/MessageList.js index 379909a2d..897f6d176 100644 --- a/dev/View/User/MailBox/MessageList.js +++ b/dev/View/User/MailBox/MessageList.js @@ -59,13 +59,15 @@ const */ listAction = (...args) => MessagelistUserStore.setAction(...args), - moveMessagesToFolderType = (toFolderType, bDelete) => - rl.app.moveMessagesToFolderType( + moveMessagesToFolderType = (toFolderType, bDelete) => { + let messages = MessagelistUserStore.listCheckedOrSelectedUidsWithSubMails(); + messages.size && rl.app.moveMessagesToFolderType( toFolderType, - FolderUserStore.currentFolderFullName(), - MessagelistUserStore.listCheckedOrSelectedUidsWithSubMails(), + messages.folder, + messages, bDelete - ), + ) + }, pad2 = v => 10 > v ? '0' + v : '' + v, Ymd = dt => dt.getFullYear() + pad2(1 + dt.getMonth()) + pad2(dt.getDate()),