Add OpenPGP mail encryption: decrypt, verify, encrypt, sign and contact keyring, v0.3.0

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-10-07 15:39:51 +03:00
co-authored by Copilot
parent bae9c7966d
commit 750665f96b
23 changed files with 1493 additions and 42 deletions
+14 -1
View File
@@ -584,13 +584,26 @@ if (window.daybreakMail) {
sendButton.disabled = true;
sendButton.textContent = 'Sending…';
try {
const pgp = window.pgpPrepareSend ? await window.pgpPrepareSend(recipient, $('#compose-cc').value) : null;
if (pgp === false) {
sendButton.disabled = false;
sendButton.textContent = 'Send ↗';
return;
}
const result = await window.daybreakMail.send({
to: recipient,
cc: $('#compose-cc').value,
subject: $('#compose-subject').value.trim(),
text: $('#compose-body').value,
displayName: connectedMailAccount.displayName || profileSettings.name
displayName: connectedMailAccount.displayName || profileSettings.name,
...(pgp ? { pgp } : {})
});
if (result.failed) {
sendButton.disabled = false;
sendButton.textContent = 'Send ↗';
toast(result.message || 'Message could not be encrypted');
return;
}
if (result.queued) {
const draftId = $('#modal-root .compose-modal')?.dataset.draftId;
if (draftId) await window.daybreakMail.deleteDraft(draftId);