@bobfrankston/rmfmail 1.0.567 → 1.0.570
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.js +13 -5
- package/client/app.js.map +1 -1
- package/client/app.ts +12 -4
- package/client/components/folder-tree.js +11 -0
- package/client/components/folder-tree.js.map +1 -1
- package/client/components/folder-tree.ts +8 -0
- package/client/components/message-list.js +6 -3
- package/client/components/message-list.js.map +1 -1
- package/client/components/message-list.ts +6 -3
- package/client/components/message-viewer.js +58 -5
- package/client/components/message-viewer.js.map +1 -1
- package/client/components/message-viewer.ts +58 -5
- package/client/index.html +1 -0
- package/client/lib/api-client.js +2 -2
- package/client/lib/api-client.js.map +1 -1
- package/client/lib/api-client.ts +2 -2
- package/client/lib/mailxapi.js +2 -2
- package/client/styles/components.css +13 -0
- package/package.json +3 -3
- package/packages/mailx-service/index.d.ts +1 -1
- package/packages/mailx-service/index.d.ts.map +1 -1
- package/packages/mailx-service/index.js +5 -3
- package/packages/mailx-service/index.js.map +1 -1
- package/packages/mailx-service/index.ts +5 -3
- package/packages/mailx-service/jsonrpc.js +1 -1
- package/packages/mailx-service/jsonrpc.js.map +1 -1
- package/packages/mailx-service/jsonrpc.ts +1 -1
- package/packages/mailx-service/local-store.d.ts +1 -1
- package/packages/mailx-service/local-store.d.ts.map +1 -1
- package/packages/mailx-service/local-store.js +2 -2
- package/packages/mailx-service/local-store.js.map +1 -1
- package/packages/mailx-service/local-store.ts +2 -2
- package/packages/mailx-store/db.d.ts +1 -1
- package/packages/mailx-store/db.d.ts.map +1 -1
- package/packages/mailx-store/db.js +13 -2
- package/packages/mailx-store/db.js.map +1 -1
- package/packages/mailx-store/db.ts +13 -2
|
@@ -2286,7 +2286,7 @@ export class MailxDB {
|
|
|
2286
2286
|
// ── Search ──
|
|
2287
2287
|
|
|
2288
2288
|
/** Full-text search across all messages. Supports qualifiers: from:, to:, subject: */
|
|
2289
|
-
searchMessages(query: string, page = 1, pageSize = 50, accountId?: string, folderId?: number): PagedResult<MessageEnvelope> {
|
|
2289
|
+
searchMessages(query: string, page = 1, pageSize = 50, accountId?: string, folderId?: number, includeTrashSpam = false): PagedResult<MessageEnvelope> {
|
|
2290
2290
|
query = (query || "").trim();
|
|
2291
2291
|
// Parse qualifiers (C45: extended set — date:, has:, is:, folder:).
|
|
2292
2292
|
let ftsQuery = "";
|
|
@@ -2386,13 +2386,24 @@ export class MailxDB {
|
|
|
2386
2386
|
scopeWhere = " AND m.account_id = ?";
|
|
2387
2387
|
scopeParams.push(accountId);
|
|
2388
2388
|
}
|
|
2389
|
+
// Global / account-wide search excludes trash + junk unless the
|
|
2390
|
+
// user opted in. A user typing "invoice" in the search box almost
|
|
2391
|
+
// never wants the deleted/spam copy that's already filtered out
|
|
2392
|
+
// of every other view. When the user IS explicitly scoped to
|
|
2393
|
+
// trash/junk via folderId, this guard is skipped.
|
|
2394
|
+
if (!includeTrashSpam && !folderId) {
|
|
2395
|
+
scopeWhere += " AND (f.special_use IS NULL OR f.special_use NOT IN ('trash','junk'))";
|
|
2396
|
+
}
|
|
2389
2397
|
if (extraWhere.length > 0) {
|
|
2390
2398
|
scopeWhere += " AND " + extraWhere.join(" AND ");
|
|
2391
2399
|
scopeParams.push(...extraParams);
|
|
2392
2400
|
}
|
|
2393
2401
|
|
|
2394
2402
|
const countRow = this.db.prepare(
|
|
2395
|
-
`SELECT COUNT(*) as cnt FROM messages m
|
|
2403
|
+
`SELECT COUNT(*) as cnt FROM messages m
|
|
2404
|
+
JOIN messages_fts fts ON m.id = fts.rowid
|
|
2405
|
+
LEFT JOIN folders f ON f.id = m.folder_id AND f.account_id = m.account_id
|
|
2406
|
+
WHERE messages_fts MATCH ?${scopeWhere}`
|
|
2396
2407
|
).get(ftsQuery, ...scopeParams) as any;
|
|
2397
2408
|
const total = countRow?.cnt || 0;
|
|
2398
2409
|
|