Remove body on MMS

This commit is contained in:
Skylar Ittner 2022-02-03 18:28:15 -07:00
parent e4c4d1936b
commit 2d5ac178ad

View File

@ -344,6 +344,9 @@ function sendMMS(number, from, mediauri, mimetype, callback) {
var urichunks = mediauri.split("/"); // should result in something like [ "mxc:", "", "matrix.org", "mediaidhere90473473" ] var urichunks = mediauri.split("/"); // should result in something like [ "mxc:", "", "matrix.org", "mediaidhere90473473" ]
if (urichunks.length < 4) { if (urichunks.length < 4) {
logger.error("Invalid media uri"); logger.error("Invalid media uri");
if (typeof callback == "function") {
callback(false);
}
return; return;
} }
var httpmediaurl = settings.mediaurlpath; var httpmediaurl = settings.mediaurlpath;
@ -353,7 +356,7 @@ function sendMMS(number, from, mediauri, mimetype, callback) {
var data = { var data = {
to: [number], to: [number],
from: from, from: from,
body: body, body: "",
media: [httpmediaurl] media: [httpmediaurl]
}; };
const jsondata = JSON.stringify(data); const jsondata = JSON.stringify(data);
@ -376,7 +379,9 @@ function sendMMS(number, from, mediauri, mimetype, callback) {
}); });
req.on('error', error => { req.on('error', error => {
logger.error(error); logger.error(error);
callback(false); if (typeof callback == "function") {
callback(false);
}
}); });
req.write(jsondata); req.write(jsondata);
req.end(); req.end();