Remove mx-reply earlier to skip tree walking it

This commit is contained in:
Cadence Ember
2026-08-16 22:37:01 +12:00
parent 674cd532cd
commit c0c6419bd1
+6
View File
@@ -900,6 +900,12 @@ async function eventToMessage(event, guild, channel, di) {
assert(root)
async function forEachNode(event, node) {
for (; node; node = node.nextSibling) {
// Don't process mx-reply further
if (node.nodeType === 1 && node.tagName === "MX-REPLY") {
node.remove()
continue
}
// Check written mentions
if (node.nodeType === 3 && node.nodeValue.includes("@") && !nodeIsChildOf(node, ["A", "CODE", "PRE"])) {
const result = await checkWrittenMentions(node.nodeValue, event.sender, event.room_id, guild, di)