enable room creation
This commit is contained in:
parent
884828e61f
commit
c54dd6ce0b
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user