fix: prevent draft emails from being marked as unread

This commit is contained in:
Max Hao
2026-06-15 23:00:00 +02:00
committed by Linus Rath
parent 84aced7b4e
commit f7d4f9d53c
+2 -1
View File
@@ -2175,7 +2175,7 @@ export class JMAPClient implements IJMAPClient {
cc: cc?.length ? cc.map(email => ({ email })) : undefined,
bcc: bcc?.length ? bcc.map(email => ({ email })) : undefined,
subject,
keywords: { "$draft": true },
keywords: { "$seen": true, "$draft": true },
mailboxIds: { [draftsMailbox.id]: true },
bodyValues: htmlBody
? { "text": { value: body }, "html": { value: htmlBody } }
@@ -6259,6 +6259,7 @@ export class JMAPClient implements IJMAPClient {
const update: Record<string, unknown> = {
[`mailboxIds/${draftMailboxId}`]: true,
'keywords/$draft': true,
'keywords/$seen': true,
};
if (sentMailboxId) {
update[`mailboxIds/${sentMailboxId}`] = null;