diff --git a/Source/Services/Room.js b/Source/Services/Room.js index 924d3f4..37f12c9 100644 --- a/Source/Services/Room.js +++ b/Source/Services/Room.js @@ -481,6 +481,21 @@ addService(({ status : "success" }); } + case 'room/list':{ + let rooms = []; + for (const [id, {accessType,name,joinType,description}] of Room.rooms) if(accessType == "public"){ + rooms.push({ + name, + joinType, + description, + id + }) + } + end({ + type:'public/rooms', + rooms + }); + } default:{ next(); } diff --git a/test.html b/test.html index 595ed83..aaa0108 100644 --- a/test.html +++ b/test.html @@ -9,7 +9,7 @@