Formatted html message wasn't converting to a string.

This commit is contained in:
Skylar Sadlier 2021-09-03 11:19:19 -06:00
parent be5416a68e
commit aaecaaec39

View File

@ -109,7 +109,10 @@ module.exports = function(RED) {
if(msgFormat === 'html') {
content.format = "org.matrix.custom.html";
content.formatted_body = msg.formatted_payload || msg.payload;
content.formatted_body =
(typeof msg.formatted_payload !== 'undefined' && msg.formatted_payload)
? msg.formatted_payload.toString()
: msg.payload.toString();
}
node.server.matrixClient.sendMessage(msg.topic, content)