From e5f7c7fdcb2fb2f3bddfce70793383f6eaf147e5 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Thu, 31 Oct 2024 11:53:34 +1300 Subject: [PATCH 1/2] Proxy discord attachment links within embeds --- src/d2m/converters/message-to-event.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d2m/converters/message-to-event.js b/src/d2m/converters/message-to-event.js index 3466b4c..c141e29 100644 --- a/src/d2m/converters/message-to-event.js +++ b/src/d2m/converters/message-to-event.js @@ -602,9 +602,9 @@ async function messageToEvent(message, guild, options = {}, di) { let chosenImage = embed.image?.url // the thumbnail seems to be used for "article" type but displayed big at the bottom by discord if (embed.type === "article" && embed.thumbnail?.url && !chosenImage) chosenImage = embed.thumbnail.url - if (chosenImage) rep.addParagraph(`📸 ${chosenImage}`) + if (chosenImage) rep.addParagraph(`📸 ${dUtils.getPublicUrlForCdn(chosenImage)}`) - if (embed.video?.url) rep.addParagraph(`🎞️ ${embed.video.url}`) + if (embed.video?.url) rep.addParagraph(`🎞️ ${dUtils.getPublicUrlForCdn(embed.video.url)}`) if (embed.footer?.text) rep.addLine(`— ${embed.footer.text}`, tag`— ${embed.footer.text}`) let {body, formatted_body: html} = rep.get() From cce432aeeed0367a33c2ccbc7835d86f5d92d68f Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Thu, 31 Oct 2024 11:55:54 +1300 Subject: [PATCH 2/2] Compatibility: send {} with room joins Now compatible with the spec and with condu(wu)it. --- src/matrix/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/matrix/api.js b/src/matrix/api.js index 7f6be01..79dd7f0 100644 --- a/src/matrix/api.js +++ b/src/matrix/api.js @@ -60,7 +60,7 @@ async function createRoom(content) { */ async function joinRoom(roomIDOrAlias, mxid) { /** @type {Ty.R.RoomJoined} */ - const root = await mreq.mreq("POST", path(`/client/v3/join/${roomIDOrAlias}`, mxid)) + const root = await mreq.mreq("POST", path(`/client/v3/join/${roomIDOrAlias}`, mxid), {}) return root.room_id }