be idomatic

Co-authored-by: Travis Ralston <travisr@matrix.org>
This commit is contained in:
Shay 2024-07-29 09:30:20 -07:00 committed by GitHub
parent bde03c2a75
commit 480420590c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,7 +37,7 @@ export class MessageIsMedia extends Protection {
if (event['type'] === 'm.room.message') { if (event['type'] === 'm.room.message') {
let content = event['content'] || {}; let content = event['content'] || {};
const relation = content["m.relates_to"] 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; content = content?.["m.new_content"] ?? content;
} }
const msgtype = content['msgtype'] || 'm.text'; const msgtype = content['msgtype'] || 'm.text';