Compare commits

...

2 commits

Author SHA1 Message Date
401985a861 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.
2026-07-03 22:36:21 +12:00
cad815896b 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.
2026-07-03 22:35:10 +12:00
3 changed files with 3 additions and 3 deletions

View file

@ -24,7 +24,7 @@ class DiscordClient {
const intents = [ const intents = [
"DIRECT_MESSAGES", "DIRECT_MESSAGE_REACTIONS", "DIRECT_MESSAGE_TYPING", "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", "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") if (reg.ooye.receive_presences !== false) intents.push("GUILD_PRESENCES")
this.discordToken = discordToken this.discordToken = discordToken

View file

@ -474,7 +474,7 @@ async function ping() {
async function getMedia(mxc, init = {}) { async function getMedia(mxc, init = {}) {
init = {...init} init = {...init}
const mediaParts = mxc?.match(/^mxc:\/\/([^/]+)\/(\w+)$/) const mediaParts = mxc?.match(/^mxc:\/\/([^/]+)\/([a-zA-Z0-9_-]+)$/)
assert(mediaParts) assert(mediaParts)
let route = "download" let route = "download"

View file

@ -250,7 +250,7 @@ function getPublicUrlForMxc(mxc) {
*/ */
function makeMxcPublic(mxc) { function makeMxcPublic(mxc) {
assert(hasher, "xxhash is not ready yet") 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 if (!mediaParts) return undefined
const serverAndMediaID = `${mediaParts[1]}/${mediaParts[2]}` const serverAndMediaID = `${mediaParts[1]}/${mediaParts[2]}`