@bobfrankston/mailx 1.0.294 → 1.0.295
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.
|
@@ -220,7 +220,7 @@ export async function loadSearchResults(query, scope = "all", accountId = "", fo
|
|
|
220
220
|
}
|
|
221
221
|
const source = scope === "current" && accountId
|
|
222
222
|
? await apiGetMessages(accountId, folderId, 1, 10000)
|
|
223
|
-
: await
|
|
223
|
+
: await apiGetUnifiedInbox(1, 10000);
|
|
224
224
|
const matches = source.items.filter((m) => regex.test(m.subject || "") || regex.test(m.from?.name || "") || regex.test(m.from?.address || "") || regex.test(m.preview || ""));
|
|
225
225
|
totalMessages = matches.length;
|
|
226
226
|
state.setMessages(matches);
|
package/package.json
CHANGED
|
@@ -570,8 +570,17 @@ export class MailxDB {
|
|
|
570
570
|
ftsQuery += `subject:${term} `;
|
|
571
571
|
}
|
|
572
572
|
else {
|
|
573
|
-
// Unqualified — search everything
|
|
574
|
-
|
|
573
|
+
// Unqualified — search everything.
|
|
574
|
+
// Support "term1|term2" (regex OR) by converting to FTS5 OR.
|
|
575
|
+
// Strip surrounding /.../ if user typed regex delimiters.
|
|
576
|
+
let term = part.replace(/^\/|\/$/g, "");
|
|
577
|
+
if (term.includes("|")) {
|
|
578
|
+
const alts = term.split("|").filter(Boolean).map(t => `${t}*`).join(" OR ");
|
|
579
|
+
ftsQuery += `(${alts}) `;
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
ftsQuery += `${term}* `;
|
|
583
|
+
}
|
|
575
584
|
}
|
|
576
585
|
}
|
|
577
586
|
ftsQuery = ftsQuery.trim();
|