diff --git a/channel.js b/channel.js index de601cc0..466cf66d 100644 --- a/channel.js +++ b/channel.js @@ -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; } diff --git a/chatcommand.js b/chatcommand.js index 388bee42..1ad2d946 100644 --- a/chatcommand.js +++ b/chatcommand.js @@ -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; }