m->d: Gracefully handle replies to redacted event

This commit is contained in:
Cadence Ember 2024-02-13 22:27:55 +13:00
parent f79833c444
commit 7756a34a5f
3 changed files with 59 additions and 1 deletions

View file

@ -509,6 +509,8 @@ async function eventToMessage(event, guild, di) {
const fileReplyContentAlternative = attachmentEmojis.get(repliedToEvent.content.msgtype)
if (fileReplyContentAlternative) {
contentPreview = " " + fileReplyContentAlternative
} else if (repliedToEvent.unsigned?.redacted_because) {
contentPreview = " (in reply to a deleted message)"
} else {
const repliedToContent = repliedToEvent.content.formatted_body || repliedToEvent.content.body
const contentPreviewChunks = chunk(