feat: add plugin hooks for email details, headers, and source

This commit is contained in:
Linus Rath
2026-06-25 01:04:26 +02:00
parent de56229ef2
commit 155d99a069
4 changed files with 199 additions and 138 deletions
+3
View File
@@ -4,6 +4,7 @@
import type { Email } from '@/lib/jmap/types';
import type { EmailReadView } from '@/lib/plugin-types';
import { generateEmailSource } from '@/lib/email-source';
// Resolve a message's plain-text body from its JMAP body parts. Plugins that
// translate or scan content need the real body, not just the short `preview`
@@ -54,6 +55,8 @@ export function emailToReadView(email: Email): EmailReadView {
hasAttachment: email.hasAttachment,
preview: email.preview || '',
text: plainTextFromEmail(email),
headers: email.headers,
source: generateEmailSource(email),
keywords: Object.keys(email.keywords || {}).filter(k => email.keywords[k]),
auth: email.authenticationResults,
};