channel/chat: don't allow users to unmute themselves

This commit is contained in:
calzoneman 2015-09-26 19:54:20 -07:00
parent 237a4ae0e0
commit c5e73e156a
1 changed files with 7 additions and 0 deletions

View File

@ -584,6 +584,13 @@ ChatModule.prototype.handleCmdUnmute = function (user, msg, meta) {
}
name = name.toLowerCase();
if (name === user.getName().toLowerCase()) {
user.socket.emit("errorMsg", {
msg: "You are not allowed to unmute yourself"
});
return;
}
if (!this.isMuted(name)) {
user.socket.emit("errorMsg", {
msg: name + " is not muted."