Fix user join ban check for users with blank names (but clean IPs)
This commit is contained in:
parent
f6500ff745
commit
a594b19745
4 changed files with 143 additions and 5 deletions
|
|
@ -59,16 +59,22 @@ KickBanModule.prototype.onUserPreJoin = function (user, data, cb) {
|
|||
return cb(null, ChannelModule.PASSTHROUGH);
|
||||
}
|
||||
|
||||
var cname = this.channel.name;
|
||||
checkBan(cname, user.realip, user.getName(), function (banned) {
|
||||
const cname = this.channel.name;
|
||||
const check = (user.getName() !== '') ? checkBan : checkIPBan;
|
||||
function callback(banned) {
|
||||
if (banned) {
|
||||
cb(null, ChannelModule.DENY);
|
||||
user.kick("You are banned from this channel.");
|
||||
} else {
|
||||
cb(null, ChannelModule.PASSTHROUGH);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (user.getName() !== '') {
|
||||
checkBan(cname, user.realip, user.getName(), callback);
|
||||
} else {
|
||||
checkIPBan(cname, user.realip, callback);
|
||||
}
|
||||
};
|
||||
|
||||
KickBanModule.prototype.onUserPostJoin = function (user) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue