A couple fixes

This commit is contained in:
calzoneman 2013-08-18 19:31:34 -05:00
parent e3ef9e7896
commit d100936b65
2 changed files with 14 additions and 3 deletions

View File

@ -525,7 +525,7 @@ Channel.prototype.tryNameBan = function(actor, name) {
if(rank >= actor.rank) {
actor.socket.emit("errorMsg", {
msg: "You don't have permission to ban this person."
msg: "You don't have permission to ban " + name
});
return;
}

View File

@ -145,10 +145,21 @@ function handleUnmute(chan, user, args) {
function handleKick(chan, user, args) {
if(chan.hasPermission(user, "kick") && args.length > 0) {
args[0] = args[0].toLowerCase();
if(args[0] == user.name.toLowerCase()) {
user.socket.emit("costanza", {
msg: "Kicking yourself?"
});
return;
}
var kickee;
for(var i = 0; i < chan.users.length; i++) {
if(chan.users[i].name.toLowerCase() == args[0] &&
chan.getRank(chan.users[i].name) < user.rank) {
if(chan.users[i].name.toLowerCase() == args[0]) {
if(chan.users[i].rank >= user.rank) {
user.socket.emit("errorMsg", {
msg: "You don't have permission to kick " + args[0]
});
return;
}
kickee = chan.users[i];
break;
}