Forwarding text messages

This commit is contained in:
Cadence Ember 2024-11-01 16:39:56 +13:00
commit 1b539cfa64
4 changed files with 138 additions and 5 deletions

View file

@ -555,9 +555,8 @@ async function messageToEvent(message, guild, options = {}, di) {
// Try to merge the forwarded content with the forwarded notice
let {body, formatted_body} = forwardedNotice.get()
if (forwardedEvents.length >= 1 && ["m.text", "m.notice"].includes(forwardedEvents[0].msgtype)) { // Try to merge the forwarded content and the forwarded notice
forwardedNotice.add("\n", "<br>")
forwardedEvents[0].body = body + forwardedEvents[0].body
forwardedEvents[0].formatted_body = formatted_body + forwardedEvents[0].formatted_body
forwardedEvents[0].body = body + "\n" + forwardedEvents[0].body
forwardedEvents[0].formatted_body = formatted_body + "<br>" + forwardedEvents[0].formatted_body
} else {
await addTextEvent(body, formatted_body, "m.notice")
}