diff --git a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-news/news.js b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-news/news.js index e7af56fa..0d8e1940 100644 --- a/zefie_wtvp_minisrv/includes/ServiceVault/wtv-news/news.js +++ b/zefie_wtvp_minisrv/includes/ServiceVault/wtv-news/news.js @@ -614,34 +614,43 @@ From: `; var allow_html = false; + var body_data = ''; + var attachment_data = ''; + var signature_data = ''; + if (message_body) { if (message_body.indexOf("") >= 0) { allow_html = true; } + body_data += (allow_html) ? wtvshared.sanitizeSignature(message_body) : wtvshared.htmlEntitize(message_body, true) + body_data += `

`; } - data += (allow_html) ? wtvshared.sanitizeSignature(message_body) : wtvshared.htmlEntitize(message_body, true) - data += ` -
-
`; - if (signature) data += wtvshared.sanitizeSignature(signature); - data += "

"; + + if (signature) signature_data += wtvshared.sanitizeSignature(signature); + if (attachments) { + if (attachments[0]) { + if (attachments[0].filename == "message.html") { + body_data += wtvshared.sanitizeSignature(attachments[0].data); + delete attachments[0]; + } + } var supported_images = /image\/(jpe?g|png|gif|x-wtv-bitmap)/; var supported_audio = /audio\/(mp[eg|2|3]|midi?|wav|x-wav|mod|x-mod)/; attachments.forEach((v, k) => { if (v.content_type) { if (v.content_type.match(supported_images)) - data += `

`; + attachment_data += `

`; else if (v.content_type.match(supported_audio)) - data += ` + attachment_data += `
  ${(v.filename) ? (v.filename) : "Audio file"} (${v.content_type.split('/')[1]} attachment)


`; else if (v.content_type.match("text/html")) - data += wtvshared.sanitizeSignature(v.data); + attachment_data += wtvshared.sanitizeSignature(v.data); else - data += `
A file ${(v.filename) ? `(${v.filename}) ` : ''}that WebTV cannot use, with type ${v.content_type} is attached to this message.` + attachment_data += `
A file ${(v.filename) ? `(${v.filename}) ` : ''}that WebTV cannot use, with type ${v.content_type} is attached to this message.` } }); } @@ -650,6 +659,9 @@ From: data += `Included Page: ${wtvshared.htmlEntitize(message.url_title).replace(/'/gi, "'")}`; } */ + data += body_data; + data += signature_data + "

"; + data += attachment_data; data += "

"; sendToClient(socket, headers, data);