From 480420590c741ce5622f07ff8afe52100736683e Mon Sep 17 00:00:00 2001 From: Shay Date: Mon, 29 Jul 2024 09:30:20 -0700 Subject: [PATCH] be idomatic Co-authored-by: Travis Ralston --- src/protections/MessageIsMedia.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protections/MessageIsMedia.ts b/src/protections/MessageIsMedia.ts index 791db1a..7349913 100644 --- a/src/protections/MessageIsMedia.ts +++ b/src/protections/MessageIsMedia.ts @@ -37,7 +37,7 @@ export class MessageIsMedia extends Protection { if (event['type'] === 'm.room.message') { let content = event['content'] || {}; const relation = content["m.relates_to"] - if (relation && relation["rel_type"] === "m.replace") { + if (relation?.["rel_type"] === "m.replace") { content = content?.["m.new_content"] ?? content; } const msgtype = content['msgtype'] || 'm.text';