fix/optimize wtv-mail

This commit is contained in:
zefie
2025-08-12 19:33:00 -04:00
parent 74ec365ae1
commit 8307620004
11 changed files with 110 additions and 118 deletions

View File

@@ -1,12 +1,11 @@
var minisrv_service_file = true;
const minisrv_service_file = true;
var errpage = null;
var messageid = request_headers.query.message_id;
var attachment_id = request_headers.query.attachment_id;
let errpage, message;
const messageid = request_headers.query.message_id;
const attachment_id = request_headers.query.attachment_id;
if (!attachment_id && attachment_id != 0) errpage = wtvshared.doErrorPage(400, "Attachment ID required.");
else {
var message = session_data.mailstore.getMessageByID(messageid);
message = session_data.mailstore.getMessageByID(messageid);
if (!message) errpage = wtvshared.doErrorPage(400, "Invalid Message ID");
else {
if (!message.attachments) message.attachments = []; // backwards compat