mirror of
https://github.com/bulwarkmail/native.git
synced 2026-11-01 00:07:01 +00:00
fix: leave a server's own all mailbox out of all mail and unread (bulwarkmail/webmail#1241)
This commit is contained in:
@@ -45,6 +45,15 @@ describe('buildFilter (aggregated views)', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("buildFilter: a server's own all mailbox (bulwarkmail/webmail#1241)", () => {
|
||||
it('is left out of All mail and Unread', () => {
|
||||
const withAll = [...MAILBOXES, mailbox('every', 'all')];
|
||||
expect(buildFilter(withAll, { view: 'all' })).toEqual({
|
||||
operator: 'OR', conditions: [{ inMailbox: 'in' }, { inMailbox: 'projects' }],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('buildFilter: searching from All mail', () => {
|
||||
const all = [...MAILBOXES, mailbox('arch', 'archive'), mailbox('drafts', 'drafts'), mailbox('spam', 'junk')];
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ import { LIST_AUTH_RESULTS_PROPERTY } from '../lib/email-headers';
|
||||
|
||||
const EMAIL_LIST_PROPERTIES = [
|
||||
'id', 'threadId', 'mailboxIds', 'keywords', 'size',
|
||||
'receivedAt', 'from', 'to', 'cc', 'subject', 'preview', 'hasAttachment',
|
||||
'receivedAt', 'from', 'to', 'cc', 'subject', 'preview', 'hasAttachment', 'sentAt',
|
||||
// The sender check, for the warning shield on a forged From (#1439).
|
||||
LIST_AUTH_RESULTS_PROPERTY,
|
||||
];
|
||||
@@ -32,9 +32,13 @@ const MAILBOX_CACHE_TTL_MS = 60 * 1000;
|
||||
export type UnifiedRole = 'inbox' | 'sent' | 'drafts' | 'junk' | 'archive' | 'trash';
|
||||
export type CrossView = 'all' | 'unread' | 'starred';
|
||||
|
||||
/** Roles left out of the cross-account All mail / Unread / Starred views. */
|
||||
/**
|
||||
* Roles left out of the cross-account All mail / Unread / Starred views. A
|
||||
* server's own "all" mailbox holds every message again, so listing it beside
|
||||
* the real folders doubled them (webmail lib/jmap/types.ts, #1241).
|
||||
*/
|
||||
export const CROSS_EXCLUDED_ROLES: ReadonlySet<string> = new Set([
|
||||
'junk', 'spam', 'sent', 'archive', 'trash', 'drafts',
|
||||
'junk', 'spam', 'sent', 'archive', 'trash', 'drafts', 'all',
|
||||
]);
|
||||
|
||||
export interface UnifiedEmail extends Email {
|
||||
|
||||
Reference in New Issue
Block a user