enable room creation

This commit is contained in:
HF 2022-01-14 01:57:47 +01:00
parent 884828e61f
commit c54dd6ce0b

View File

@ -186,11 +186,11 @@ class PPfunMatrixBridge {
room_id = await intent.resolveRoom(alias);
} catch {
console.log(`Matrix room ${alias} does not exist. Try to create it`);
if (ppfun_name === 'es') {
/*
* see https://spec.matrix.org/v1.1/client-server-api/
* look for requestBody of createRoom
*/
/*
* see https://spec.matrix.org/v1.1/client-server-api/
* look for requestBody of createRoom
*/
try {
room_id = await intent.createRoom({
options: {
name: `[${ppfun_name}] pixelplanet.fun`,
@ -202,6 +202,8 @@ class PPfunMatrixBridge {
});
room_id = room_id.room_id;
await intent.setRoomAvatar(room_id, 'mxc://pixelplanet.fun/cXJRbbaaqkzpOydGVxASpizK');
} catch (e) {
console.log(`Could not create new room for ${alias}: ${e}`);
}
}
if (room_id) {