Fix #340; add shadowchat option for moderators
The new option allows moderators to see what shadowmuted users are saying. When enabled, messages from shadowmuted users will appear in a darker (or lighter, depending on theme) font and struck through.
This commit is contained in:
parent
37db972d86
commit
42e590c6fd
9 changed files with 43 additions and 8 deletions
|
|
@ -2895,13 +2895,7 @@ Channel.prototype.handleChat = function (user, data) {
|
|||
user.socket.emit("chatCooldown", 1000 / this.opts.chat_antiflood_params.sustained);
|
||||
}
|
||||
|
||||
if (muted) {
|
||||
user.socket.emit("noflood", {
|
||||
action: "chat",
|
||||
msg: "You have been muted on this channel."
|
||||
});
|
||||
return;
|
||||
} else if (smuted) {
|
||||
if (smuted) {
|
||||
msg = XSS.sanitizeText(msg);
|
||||
msg = this.filterMessage(msg);
|
||||
var msgobj = {
|
||||
|
|
@ -2913,6 +2907,17 @@ Channel.prototype.handleChat = function (user, data) {
|
|||
this.shadowMutedUsers().forEach(function (u) {
|
||||
u.socket.emit("chatMsg", msgobj);
|
||||
});
|
||||
|
||||
msgobj.meta.shadow = true;
|
||||
this.channelModerators().forEach(function (u) {
|
||||
u.socket.emit("chatMsg", msgobj);
|
||||
});
|
||||
return;
|
||||
} else if (muted) {
|
||||
user.socket.emit("noflood", {
|
||||
action: "chat",
|
||||
msg: "You have been muted on this channel."
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue