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" ]
if (urichunks.length < 4) {
logger.error("Invalid media uri");
if (typeof callback == "function") {
callback(false);
}
return;
}
var httpmediaurl = settings.mediaurlpath;
@ -353,7 +356,7 @@ function sendMMS(number, from, mediauri, mimetype, callback) {
var data = {
to: [number],
from: from,
body: body,
body: "",
media: [httpmediaurl]
};
const jsondata = JSON.stringify(data);
@ -376,7 +379,9 @@ function sendMMS(number, from, mediauri, mimetype, callback) {
});
req.on('error', error => {
logger.error(error);
callback(false);
if (typeof callback == "function") {
callback(false);
}
});
req.write(jsondata);
req.end();