@bobfrankston/rmfmail 1.2.216 → 1.2.219
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/app.bundle.js +14 -14
- package/client/app.bundle.js.map +3 -3
- package/client/app.js +20 -15
- package/client/app.js.map +1 -1
- package/client/app.ts +19 -13
- package/client/compose/compose.bundle.js +2 -1
- package/client/compose/compose.bundle.js.map +2 -2
- package/client/lib/api-client.js +7 -2
- package/client/lib/api-client.js.map +1 -1
- package/client/lib/api-client.ts +7 -1
- package/package.json +5 -5
- package/packages/mailx-imap/index.d.ts +8 -0
- package/packages/mailx-imap/index.d.ts.map +1 -1
- package/packages/mailx-imap/index.js +36 -2
- package/packages/mailx-imap/index.js.map +1 -1
- package/packages/mailx-imap/index.ts +34 -3
- package/packages/mailx-imap/package-lock.json +2 -2
- package/packages/mailx-imap/package.json +1 -1
- /package/packages/mailx-imap/{node_modules.npmglobalize-stash-25568 → node_modules.npmglobalize-stash-24032}/.package-lock.json +0 -0
package/client/app.bundle.js
CHANGED
|
@@ -360,8 +360,9 @@ function deleteMessages(accountId, uids, folderIds) {
|
|
|
360
360
|
return ipc().deleteMessages?.(accountId, uids, folderIds);
|
|
361
361
|
}
|
|
362
362
|
function moveMessages(accountId, uids, targetFolderId, folderIds, targetAccountId) {
|
|
363
|
-
if (uids.length === 1)
|
|
363
|
+
if (uids.length === 1 && (targetAccountId || !folderIds?.length)) {
|
|
364
364
|
return moveMessage(accountId, uids[0], targetFolderId, targetAccountId);
|
|
365
|
+
}
|
|
365
366
|
return ipc().moveMessages?.(accountId, uids, targetFolderId, folderIds);
|
|
366
367
|
}
|
|
367
368
|
function markAsSpamMessages(accountId, uids, folderIds) {
|
|
@@ -9304,17 +9305,17 @@ async function performUndo() {
|
|
|
9304
9305
|
return;
|
|
9305
9306
|
}
|
|
9306
9307
|
} else if (op.kind === "move") {
|
|
9307
|
-
const { messages: messages2 } = op.payload;
|
|
9308
|
+
const { messages: messages2, targetFolderId } = op.payload;
|
|
9308
9309
|
const byDest = /* @__PURE__ */ new Map();
|
|
9309
9310
|
for (const m of messages2) {
|
|
9310
9311
|
const key = `${m.accountId}:${m.sourceFolderId}`;
|
|
9311
9312
|
if (!byDest.has(key)) byDest.set(key, { accountId: m.accountId, folderId: m.sourceFolderId, uids: [] });
|
|
9312
9313
|
byDest.get(key).uids.push(m.uid);
|
|
9313
9314
|
}
|
|
9314
|
-
const { moveMessages: moveMessages2
|
|
9315
|
+
const { moveMessages: moveMessages2 } = await Promise.resolve().then(() => (init_api_client(), api_client_exports));
|
|
9315
9316
|
for (const group of byDest.values()) {
|
|
9316
|
-
|
|
9317
|
-
|
|
9317
|
+
const currentFolderIds = targetFolderId ? group.uids.map(() => targetFolderId) : void 0;
|
|
9318
|
+
await moveMessages2(group.accountId, group.uids, group.folderId, currentFolderIds);
|
|
9318
9319
|
}
|
|
9319
9320
|
if (statusSync) statusSync.textContent = `Undid move of ${messages2.length} message${messages2.length !== 1 ? "s" : ""}${remaining}`;
|
|
9320
9321
|
const firstMoved = messages2[0];
|
|
@@ -9563,19 +9564,18 @@ async function spamSelectedMessages() {
|
|
|
9563
9564
|
g.folderIds.push(msg.folderId);
|
|
9564
9565
|
byAccount.set(msg.accountId, g);
|
|
9565
9566
|
}
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
|
-
|
|
9571
|
-
|
|
9572
|
-
|
|
9573
|
-
}
|
|
9574
|
-
});
|
|
9567
|
+
const spamUndo = {
|
|
9568
|
+
messages: snapshot.map((m) => ({ accountId: m.accountId, uid: m.uid, sourceFolderId: m.folderId })),
|
|
9569
|
+
targetAccountId: snapshot[0].accountId,
|
|
9570
|
+
targetFolderId: 0
|
|
9571
|
+
// filled in below — only the service knows which folder is \Junk
|
|
9572
|
+
};
|
|
9573
|
+
pushUndo({ kind: "move", at: Date.now(), payload: spamUndo });
|
|
9575
9574
|
if (statusSync) statusSync.textContent = `Spam: ${snapshot.length} queued \u2014 Ctrl+Z to undo`;
|
|
9576
9575
|
for (const [accountId, { uids, folderIds }] of byAccount) {
|
|
9577
9576
|
markAsSpamMessages(accountId, uids, folderIds).then((result) => {
|
|
9578
9577
|
console.log(`[spam] ${accountId}: moved ${result?.moved ?? uids.length} to folderId=${result?.targetFolderId}`);
|
|
9578
|
+
if (result?.targetFolderId) spamUndo.targetFolderId = result.targetFolderId;
|
|
9579
9579
|
}).catch((e) => {
|
|
9580
9580
|
console.error(`[spam] ${accountId} failed:`, e);
|
|
9581
9581
|
if (statusSync) statusSync.textContent = `Spam sync issue (${accountId}): ${e?.message || e}`;
|