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

View file

@ -584,6 +584,13 @@ ChatModule.prototype.handleCmdUnmute = function (user, msg, meta) {
} }
name = name.toLowerCase(); 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)) { if (!this.isMuted(name)) {
user.socket.emit("errorMsg", { user.socket.emit("errorMsg", {
msg: name + " is not muted." msg: name + " is not muted."