Provisioner: normalize bare room IDs to full !id:server form (tuwunel returns localpart)
This commit is contained in:
parent
e3a6e9da97
commit
27a7b72984
1 changed files with 7 additions and 1 deletions
|
|
@ -115,7 +115,13 @@ export class MatrixHttpClient implements MatrixAdminPort {
|
||||||
if (typeof body.room_id !== "string" || body.room_id === "") {
|
if (typeof body.room_id !== "string" || body.room_id === "") {
|
||||||
throw new ProvisionerUnavailableError("createRoom response missing room_id");
|
throw new ProvisionerUnavailableError("createRoom response missing room_id");
|
||||||
}
|
}
|
||||||
return { roomId: body.room_id };
|
// Some homeservers return the bare localpart; the full room ID carries the
|
||||||
|
// server name, and every downstream consumer (DB checks, invites, joins)
|
||||||
|
// requires the complete form.
|
||||||
|
const roomId = body.room_id.includes(":")
|
||||||
|
? body.room_id
|
||||||
|
: `${body.room_id}:${this.config.homeserverUrl.host}`;
|
||||||
|
return { roomId };
|
||||||
}
|
}
|
||||||
|
|
||||||
async sendStateEvent(
|
async sendStateEvent(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue