From c5e73e156a55f2520862f2468c0b1e728e772d3d Mon Sep 17 00:00:00 2001 From: calzoneman Date: Sat, 26 Sep 2015 19:54:20 -0700 Subject: [PATCH] channel/chat: don't allow users to unmute themselves --- src/channel/chat.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/channel/chat.js b/src/channel/chat.js index 90df4502..5c44df41 100644 --- a/src/channel/chat.js +++ b/src/channel/chat.js @@ -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."