[mirotalksfu] - improve host protection mode
هذا الالتزام موجود في:
@@ -3,6 +3,7 @@
|
||||
module.exports = class Host {
|
||||
constructor() {
|
||||
this.authorizedIPs = new Map();
|
||||
this.roomActive = false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -20,6 +21,7 @@ module.exports = class Host {
|
||||
*/
|
||||
setAuthorizedIP(ip, authorized) {
|
||||
this.authorizedIPs.set(ip, authorized);
|
||||
this.roomActive = true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,12 +33,21 @@ module.exports = class Host {
|
||||
return this.authorizedIPs.has(ip);
|
||||
}
|
||||
|
||||
/**
|
||||
* Host room active
|
||||
* @returns boolean
|
||||
*/
|
||||
isRoomActive() {
|
||||
return this.roomActive;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete ip from authorized IPs
|
||||
* @param {string} ip
|
||||
* @returns boolean
|
||||
*/
|
||||
deleteIP(ip) {
|
||||
this.roomActive = false;
|
||||
return this.authorizedIPs.delete(ip);
|
||||
}
|
||||
};
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم