Fix shadowmuted users usage of greentext and slash commands

This commit is contained in:
Xaekai 2015-05-19 00:03:02 -07:00
parent 88be0e1e92
commit 7f269784b1
1 changed files with 20 additions and 21 deletions

View File

@ -268,6 +268,25 @@ ChatModule.prototype.processChatMsg = function (user, data) {
return; return;
} }
if (data.msg.indexOf(">") === 0) {
msgobj.meta.addClass = "greentext";
}
if (data.msg.indexOf("/") === 0) {
var space = data.msg.indexOf(" ");
var cmd;
if (space < 0) {
cmd = data.msg.substring(1);
} else {
cmd = data.msg.substring(1, space);
}
if (cmd in this.commandHandlers) {
this.commandHandlers[cmd](user, data.msg, data.meta);
return;
}
}
if (user.is(Flags.U_SMUTED)) { if (user.is(Flags.U_SMUTED)) {
this.shadowMutedUsers().forEach(function (u) { this.shadowMutedUsers().forEach(function (u) {
u.socket.emit("chatMsg", msgobj); u.socket.emit("chatMsg", msgobj);
@ -284,27 +303,7 @@ ChatModule.prototype.processChatMsg = function (user, data) {
}); });
return; return;
} }
this.sendMessage(msgobj);
if (data.msg.indexOf("/") === 0) {
var space = data.msg.indexOf(" ");
var cmd;
if (space < 0) {
cmd = data.msg.substring(1);
} else {
cmd = data.msg.substring(1, space);
}
if (cmd in this.commandHandlers) {
this.commandHandlers[cmd](user, data.msg, data.meta);
} else {
this.sendMessage(msgobj);
}
} else {
if (data.msg.indexOf(">") === 0) {
msgobj.meta.addClass = "greentext";
}
this.sendMessage(msgobj);
}
}; };
ChatModule.prototype.formatMessage = function (username, data) { ChatModule.prototype.formatMessage = function (username, data) {