v0.2.20
RustBox CI / rustbox (push) Canceled after 0s

This commit is contained in:
Mateusz Gruszczyński committed 2026-11-03 16:07:58 +01:00
1 parent 9003a50eb4
commit 2486856799
21 files changed
+538 -30

No files matched your search

+5
View File
@@ -577,6 +577,11 @@
"Markdown preview": "Podgląd Markdown",
"Recovered draft": "Odzyskany szkic",
"Forward as attachment": "Przekaż jako załącznik",
"Attaching message…": "Dołączanie wiadomości…",
"Message attached": "Wiadomość dołączona",
"Could not prepare draft for attachment": "Nie udało się przygotować szkicu do załączenia wiadomości",
"Message attachment was not created": "Nie utworzono załącznika z wiadomością",
"Could not attach message": "Nie udało się dołączyć wiadomości",
"Open": "Otwórz",
"Preview": "Podgląd",
"Download": "Pobierz",
+31 -9
View File
@@ -935,16 +935,38 @@ async function downloadEml() {
async function forwardAsAttachment() {
const detail = state.currentDetail;
if (!detail) return;
openCompose("new");
state.composeAction = "forward";
$("#compose-title").textContent = trText("Forward as attachment");
$("#compose-subject").value = /^fwd:/i.test(detail.subject || "") ? detail.subject : `Fwd: ${detail.subject || ""}`;
state.composeUploading = true;
setComposeUploadProgress(true, 20, trText("Attaching message…"));
updateComposeDraftDeleteAction();
try {
const blob = await fetchEmlBlob(detail);
openCompose("new");
state.composeAction = "forward";
$("#compose-title").textContent = trText("Forward as attachment");
$("#compose-subject").value = /^fwd:/i.test(detail.subject || "") ? detail.subject : `Fwd: ${detail.subject || ""}`;
const safe = String(detail.subject || `message-${detail.uid}`).replace(/[\\/:*?"<>|]+/g, "_").slice(0, 120) || `message-${detail.uid}`;
const file = new File([blob], `${safe}.eml`, { type: "message/rfc822" });
await uploadComposeFiles([file]);
} catch (error) { toast(error.message, "error"); }
const saved = await saveCurrentDraft(true, true);
if (!saved) throw new Error(trText("Could not prepare draft for attachment"));
const draftId = ensureDraftId();
const data = await request(`/drafts/${encodeURIComponent(draftId)}/attachments/from-message`, {
method: "POST",
body: JSON.stringify({ folder: detail.folder, uid: Number(detail.uid) }),
});
const attached = Array.isArray(data.attachments) ? data.attachments : [];
if (!attached.length) throw new Error(trText("Message attachment was not created"));
state.composeAttachments = mergeComposeAttachments(state.composeAttachments, attached);
state.composeDirty = true;
state.composeNeedsRemoteSync = true;
renderComposeAttachments();
storeLocalDraftSnapshot();
setComposeUploadProgress(true, 100, trText("Message attached"));
setTimeout(() => { if (!state.composeUploading) setComposeUploadProgress(false); }, 450);
} catch (error) {
setComposeUploadProgress(true, 0, error?.message || trText("Could not attach message"));
toast(error?.message || trText("Could not attach message"), "error");
setTimeout(() => { if (!state.composeUploading) setComposeUploadProgress(false); }, 4800);
} finally {
state.composeUploading = false;
updateComposeDraftDeleteAction();
}
}