From cad815896b29ac42c69e896fc9ea89c20ee6bf14 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Fri, 3 Jul 2026 22:35:10 +1200 Subject: [PATCH 1/2] Relax mxc regexp The spec doesn't say which characters are permitted in the opaque ID, but in real life we at least need a hyphen. For lack of a better reference, I copied gomuks. --- src/matrix/api.js | 2 +- src/matrix/utils.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/matrix/api.js b/src/matrix/api.js index 9b7f280..f68380f 100644 --- a/src/matrix/api.js +++ b/src/matrix/api.js @@ -474,7 +474,7 @@ async function ping() { async function getMedia(mxc, init = {}) { init = {...init} - const mediaParts = mxc?.match(/^mxc:\/\/([^/]+)\/(\w+)$/) + const mediaParts = mxc?.match(/^mxc:\/\/([^/]+)\/([a-zA-Z0-9_-]+)$/) assert(mediaParts) let route = "download" diff --git a/src/matrix/utils.js b/src/matrix/utils.js index eee635b..fed71c9 100644 --- a/src/matrix/utils.js +++ b/src/matrix/utils.js @@ -250,7 +250,7 @@ function getPublicUrlForMxc(mxc) { */ function makeMxcPublic(mxc) { assert(hasher, "xxhash is not ready yet") - const mediaParts = mxc?.match(/^mxc:\/\/([^/]+)\/(\w+)$/) + const mediaParts = mxc?.match(/^mxc:\/\/([^/]+)\/([a-zA-Z0-9_-]+)$/) if (!mediaParts) return undefined const serverAndMediaID = `${mediaParts[1]}/${mediaParts[2]}` From 401985a861c0d8f134740cfaf41a58e0867d4542 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Fri, 3 Jul 2026 22:36:21 +1200 Subject: [PATCH 2/2] Fix member leaves not being propagated immediately Previously they would only be removed next time the bridge was restarted. Now it should be done in real time. --- src/d2m/discord-client.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d2m/discord-client.js b/src/d2m/discord-client.js index c2a0549..9f1d1ff 100644 --- a/src/d2m/discord-client.js +++ b/src/d2m/discord-client.js @@ -24,7 +24,7 @@ class DiscordClient { const intents = [ "DIRECT_MESSAGES", "DIRECT_MESSAGE_REACTIONS", "DIRECT_MESSAGE_TYPING", "GUILDS", "GUILD_EMOJIS_AND_STICKERS", "GUILD_MESSAGES", "GUILD_MESSAGE_REACTIONS", "GUILD_MESSAGE_TYPING", "GUILD_WEBHOOKS", "GUILD_MESSAGE_POLLS", - "MESSAGE_CONTENT" + "MESSAGE_CONTENT", "GUILD_MEMBERS" ] if (reg.ooye.receive_presences !== false) intents.push("GUILD_PRESENCES") this.discordToken = discordToken