Support MSC3725-style spoilers

This commit is contained in:
Cadence Ember
2026-02-04 01:27:31 +13:00
parent f5d50fc14e
commit 6032ba4199

View File

@@ -563,8 +563,8 @@ async function eventToMessage(event, guild, channel, di) {
let shouldProcessTextEvent = event.type === "m.room.message" && (event.content.msgtype === "m.text" || event.content.msgtype === "m.emote")
if (event.type === "m.room.message" && (event.content.msgtype === "m.file" || event.content.msgtype === "m.video" || event.content.msgtype === "m.audio" || event.content.msgtype === "m.image")) {
// Build message content in addition to the uploaded file
const fileIsSpoiler = event.content["page.codeberg.everypizza.msc4193.spoiler"]
const fileSpoilerReason = event.content["page.codeberg.everypizza.msc4193.spoiler.reason"]
const fileIsSpoiler = event.content["page.codeberg.everypizza.msc4193.spoiler"] || event.content["town.robin.msc3725.content_warning"]
const fileSpoilerReason = event.content["page.codeberg.everypizza.msc4193.spoiler.reason"] || event.content["town.robin.msc3725.content_warning"]?.description
content = ""
const captionContent = new mxUtils.MatrixStringBuilder()