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:
+14
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user