add support for html-formatted matrix messages

This commit is contained in:
murm 2023-03-17 01:42:10 -04:00
parent 0d6e3b349d
commit 8f8d5972aa

View file

@ -71,6 +71,17 @@ export default async function (matrixClient, event, room, toStartOfTimeline) {
}); });
} else if (typeof result === "object") { } else if (typeof result === "object") {
// console.log(result) // console.log(result)
if (result.html) {
const content = {
format: "org.matrix.custom.html",
body: result.html,
formatted_body: result.html,
msgtype: "m.text",
};
matrixClient.sendEvent(event.event.room_id, "m.room.message", content, "", (err, res) => {
console.log(err);
});
}
if (result.contents && result.name) { if (result.contents && result.name) {
let fileSize = 52428308; let fileSize = 52428308;
if (result.contents.length > fileSize) { if (result.contents.length > fileSize) {