Beta to stable #5

Merged
saqut merged 37 commits from beta into stable 2022-12-25 23:24:56 +03:00
1 changed files with 6 additions and 4 deletions
Showing only changes of commit a6c23b2d1b - Show all commits

View File

@ -28,6 +28,7 @@ export default class Room extends EventTarget
public name? : string;
public owner? : string;
public peers? : Map<string,Peer>;
public ifexistsJoin : boolean = false;
constructor(wsts:MWSE){
super();
@ -39,15 +40,16 @@ export default class Room extends EventTarget
{
this.roomId = options;
}else{
Object.assign({
let defaultOptions = {
joinType: "free",
ifexistsJoin: true,
accessType: "private",
notifyActionInvite: true,
notifyActionJoined: true,
notifyActionEjected: true
},options);
this.options = options;
};
Object.assign(defaultOptions,options);
this.options = defaultOptions as IRoomOptions;
}
}
@ -62,7 +64,7 @@ export default class Room extends EventTarget
});
if(result.status == 'fail')
{
if(result.message == "ALREADY-EXISTS")
if(result.message == "ALREADY-EXISTS" && this.ifexistsJoin)
{
return this.join();
}