Add permission for /clear and log it

This commit is contained in:
Calvin Montgomery 2014-07-10 20:03:47 -07:00
parent 0e8e0aef54
commit b28fd9e4a8
3 changed files with 11 additions and 3 deletions

View file

@ -375,12 +375,13 @@ ChatModule.prototype.handleCmdSay = function (user, msg, meta) {
};
ChatModule.prototype.handleCmdClear = function (user, msg, meta) {
if (user.account.effectiveRank < 2) {
if (!this.channel.modules.permissions.canClearChat(user)) {
return;
}
this.buffer = [];
this.channel.broadcastAll("clearchat");
this.channel.logger.log("[mod] " + user.getName() + " used /clear");
};
ChatModule.prototype.handleCmdAdminflair = function (user, msg, meta) {