remove iconv-lite module and accomplish the same failure with our own function
This commit is contained in:
@@ -269,31 +269,9 @@ ${html_entities.encode((message.subject) ? message.subject : '(No subject)')}
|
|||||||
<table cellspacing=0 cellpadding=0 border=0>
|
<table cellspacing=0 cellpadding=0 border=0>
|
||||||
<tr>
|
<tr>
|
||||||
<td width=425>
|
<td width=425>
|
||||||
<p>
|
<p>`;
|
||||||
`;
|
|
||||||
if (message.attachments) {
|
|
||||||
message.attachments.forEach((v, k) => {
|
|
||||||
if (v) {
|
|
||||||
console.log("*****************",v['Content-Type']);
|
|
||||||
switch (v['Content-Type']) {
|
|
||||||
case "image/jpeg":
|
|
||||||
data += `<img border=2 src="wtv-mail:/get-attachment?message_id=${messageid}&attachment_id=${k}&wtv-title=Video%20Snapshot" width="380" height="290">`;
|
|
||||||
break;
|
|
||||||
case "audio/wav":
|
|
||||||
data += `<table width=386 cellspacing=0 cellpadding=0>
|
|
||||||
<td align=left valign=middle>
|
|
||||||
<a href="wtv-mail:/get-attachment?message_id=${messageid}&attachment_id=${k}&wtv-title=Voice%20Mail" id=focus><img src="wtv-mail:/ROMCache/FileSound.gif" align=absmiddle></a> Recording
|
|
||||||
<td align=right valign=middle>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
`;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (typeof message.body == "object") {
|
if (typeof message.body == "object") {
|
||||||
message.body = iconv.decode(Buffer.from(message.body), 'ISO-8859-1');
|
message.body = wtvshared.decodeBufferText(message.body);
|
||||||
}
|
}
|
||||||
data += `
|
data += `
|
||||||
${html_entities.encode(message.body).replace(/\n/gi, "<br>").replace(/\r/gi, "").replace(/'/gi, "'")}
|
${html_entities.encode(message.body).replace(/\n/gi, "<br>").replace(/\r/gi, "").replace(/'/gi, "'")}
|
||||||
@@ -303,6 +281,28 @@ ${html_entities.encode(message.body).replace(/\n/gi, "<br>").replace(/\r/gi, "")
|
|||||||
data += ssid_sessions[socket.ssid].mailstore.sanitizeSignature(message.signature);
|
data += ssid_sessions[socket.ssid].mailstore.sanitizeSignature(message.signature);
|
||||||
}
|
}
|
||||||
data += `<p>
|
data += `<p>
|
||||||
|
`;
|
||||||
|
if (message.attachments) {
|
||||||
|
message.attachments.forEach((v, k) => {
|
||||||
|
if (v) {
|
||||||
|
console.log("*****************",v['Content-Type']);
|
||||||
|
switch (v['Content-Type']) {
|
||||||
|
case "image/jpeg":
|
||||||
|
data += `<img border=2 src="wtv-mail:/get-attachment?message_id=${messageid}&attachment_id=${k}&wtv-title=Video%20Snapshot" width="380" height="290"><br><br>`;
|
||||||
|
break;
|
||||||
|
case "audio/wav":
|
||||||
|
data += `<table href="wtv-mail:/get-attachment?message_id=${messageid}&attachment_id=${k}&wtv-title=Voice%20Mail" width=386 cellspacing=0 cellpadding=0>
|
||||||
|
<td align=left valign=middle>
|
||||||
|
<img src="wtv-mail:/ROMCache/FileSound.gif" align=absmiddle> Recording
|
||||||
|
<td align=right valign=middle>
|
||||||
|
</table><br><br>
|
||||||
|
`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
data += `<p>
|
||||||
<p>
|
<p>
|
||||||
</table>
|
</table>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -34,6 +34,15 @@ class WTVShared {
|
|||||||
return /<[a-z][\s\S]*>/i.test(str);
|
return /<[a-z][\s\S]*>/i.test(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
decodeBufferText(buf) {
|
||||||
|
var out = "";
|
||||||
|
for (var i = 0; i < buf.data.length; i++) {
|
||||||
|
console.log(buf.data[i]);
|
||||||
|
out += String.fromCharCode(buf.data[i]);
|
||||||
|
}
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
returnAbsolutePath(check_path) {
|
returnAbsolutePath(check_path) {
|
||||||
if (check_path.substring(0, 1) != this.path.sep && check_path.substring(1, 1) != ":") {
|
if (check_path.substring(0, 1) != this.path.sep && check_path.substring(1, 1) != ":") {
|
||||||
// non-absolute path, so use current directory as base
|
// non-absolute path, so use current directory as base
|
||||||
|
|||||||
20
zefie_wtvp_minisrv/package-lock.json
generated
20
zefie_wtvp_minisrv/package-lock.json
generated
@@ -13,7 +13,6 @@
|
|||||||
"easy-crc": "0.0.2",
|
"easy-crc": "0.0.2",
|
||||||
"endianness": "^8.0.2",
|
"endianness": "^8.0.2",
|
||||||
"html-entities": "^2.3.2",
|
"html-entities": "^2.3.2",
|
||||||
"iconv-lite": "^0.6.3",
|
|
||||||
"mime-types": "^2.1.33",
|
"mime-types": "^2.1.33",
|
||||||
"proxy-agent": "^5.0.0",
|
"proxy-agent": "^5.0.0",
|
||||||
"socks-proxy-agent": "^6.1.1",
|
"socks-proxy-agent": "^6.1.1",
|
||||||
@@ -290,17 +289,6 @@
|
|||||||
"node": ">= 6"
|
"node": ">= 6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/iconv-lite": {
|
|
||||||
"version": "0.6.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
|
||||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
|
||||||
"dependencies": {
|
|
||||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/inherits": {
|
"node_modules/inherits": {
|
||||||
"version": "2.0.4",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||||
@@ -864,14 +852,6 @@
|
|||||||
"debug": "4"
|
"debug": "4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"iconv-lite": {
|
|
||||||
"version": "0.6.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
|
||||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
|
||||||
"requires": {
|
|
||||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"inherits": {
|
"inherits": {
|
||||||
"version": "2.0.4",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||||
|
|||||||
@@ -31,7 +31,6 @@
|
|||||||
"easy-crc": "0.0.2",
|
"easy-crc": "0.0.2",
|
||||||
"endianness": "^8.0.2",
|
"endianness": "^8.0.2",
|
||||||
"html-entities": "^2.3.2",
|
"html-entities": "^2.3.2",
|
||||||
"iconv-lite": "^0.6.3",
|
|
||||||
"mime-types": "^2.1.33",
|
"mime-types": "^2.1.33",
|
||||||
"proxy-agent": "^5.0.0",
|
"proxy-agent": "^5.0.0",
|
||||||
"socks-proxy-agent": "^6.1.1",
|
"socks-proxy-agent": "^6.1.1",
|
||||||
|
|||||||
Reference in New Issue
Block a user