diff --git a/lib/channel.js b/lib/channel.js index bec3c73d..1b63c45b 100644 --- a/lib/channel.js +++ b/lib/channel.js @@ -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; } diff --git a/templates/useroptions.jade b/templates/useroptions.jade index c8689b55..8a630cc0 100644 --- a/templates/useroptions.jade +++ b/templates/useroptions.jade @@ -98,3 +98,4 @@ mixin us-mod form.form-horizontal(action="javascript:void(0)") mixin rcheckbox("us-modflair", "Show name color") mixin rcheckbox("us-joinmessage", "Show join messages") + mixin rcheckbox("us-shadowchat", "Show shadowmuted messages") diff --git a/www/css/cytube.css b/www/css/cytube.css index 312cc274..86a1194a 100644 --- a/www/css/cytube.css +++ b/www/css/cytube.css @@ -554,3 +554,7 @@ body.chatOnly .pm-panel, body.chatOnly .pm-panel-placeholder { border-top-left-radius: 0!important; border-top-right-radius: 0!important; } + +.chat-shadow { + text-decoration: line-through; +} diff --git a/www/css/themes/bootstrap-theme.min.css b/www/css/themes/bootstrap-theme.min.css index 482b19d9..f822f0ac 100644 --- a/www/css/themes/bootstrap-theme.min.css +++ b/www/css/themes/bootstrap-theme.min.css @@ -35,3 +35,7 @@ footer { .profile-box, .user-dropdown { background-color: #ffffff; } + +.chat-shadow { + color: #aaaaaa; +} diff --git a/www/css/themes/cyborg.css b/www/css/themes/cyborg.css index 62a246f2..322e8725 100644 --- a/www/css/themes/cyborg.css +++ b/www/css/themes/cyborg.css @@ -7725,3 +7725,7 @@ input.form-control[type="email"], textarea.form-control { color: #c8c8c8; background-color: #2d2d2d; } + +.chat-shadow { + color: #777777; +} diff --git a/www/css/themes/light.css b/www/css/themes/light.css index c39b2eaa..1add344b 100644 --- a/www/css/themes/light.css +++ b/www/css/themes/light.css @@ -25,3 +25,7 @@ footer { .profile-box, .user-dropdown { background-color: #ffffff; } + +.chat-shadow { + color: #aaaaaa; +} diff --git a/www/css/themes/slate.css b/www/css/themes/slate.css index 08ed7acc..31a37d0a 100644 --- a/www/css/themes/slate.css +++ b/www/css/themes/slate.css @@ -8012,3 +8012,7 @@ input.form-control[type="email"], textarea.form-control { .poll-notify { color: #ff9900; } + +.chat-shadow { + color: #777777; +} diff --git a/www/js/data.js b/www/js/data.js index 83376954..764c5219 100644 --- a/www/js/data.js +++ b/www/js/data.js @@ -134,7 +134,8 @@ var USEROPTS = { default_quality : getOrDefault("default_quality", ""), boop : getOrDefault("boop", false), secure_connection : getOrDefault("secure_connection", false), - no_h264 : getOrDefault("no_h264", default_noh264()) + no_h264 : getOrDefault("no_h264", default_noh264()), + show_shadowchat : getOrDefault("show_shadowchat", false) }; var VOLUME = parseFloat(getOrDefault("volume", 1)); diff --git a/www/js/util.js b/www/js/util.js index bd1e903d..c001ba1d 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -616,6 +616,7 @@ function showUserOptions() { $("#us-modflair").prop("checked", USEROPTS.modhat); $("#us-joinmessage").prop("checked", USEROPTS.joinmessage); + $("#us-shadowchat").prop("checked", USEROPTS.show_shadowchat); $("a[href='#us-general']").click(); $("#useroptions").modal(); @@ -648,6 +649,7 @@ function saveUserOptions() { if (CLIENT.rank >= 2) { USEROPTS.modhat = $("#us-modflair").prop("checked"); USEROPTS.joinmessage = $("#us-joinmessage").prop("checked"); + USEROPTS.show_shadowchat = $("#us-shadowchat").prop("checked"); } storeOpts(); @@ -1357,6 +1359,9 @@ function formatChatMessage(data, last) { if (data.meta.addClass) { message.addClass(data.meta.addClass); } + if (data.meta.shadow) { + div.addClass("chat-shadow"); + } return div; } @@ -1364,6 +1369,9 @@ function addChatMessage(data) { if(IGNORED.indexOf(data.username) !== -1) { return; } + if (data.meta.shadow && !USEROPTS.show_shadowchat) { + return; + } var div = formatChatMessage(data, LASTCHAT); // Incoming: a bunch of crap for the feature where if you hover over // a message, it highlights messages from that user