From 14a41eb99d0a9dd99a7fe33e3d5f7bca1b954ebb Mon Sep 17 00:00:00 2001 From: team1257Simon <nsimon@ucvts.tec.nj.us> Date: Tue, 2 Aug 2016 19:49:23 -0400 Subject: [PATCH] Chat: make hidden message reveal staff-only This is in tandem with https://github.com/Zarel/Pokemon-Showdown/pull/2645, and makes regular users unable to unhide text from banned users. Staff (moderator and up) retain this ability. --- js/client-chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/client-chat.js b/js/client-chat.js index 0e6b480dfd..3e69c20188 100644 --- a/js/client-chat.js +++ b/js/client-chat.js @@ -1231,7 +1231,7 @@ $messages = this.$chat.find('.chatmessage-' + user); if (!$messages.length) break; $messages.hide().addClass('revealed').find('button').parent().remove(); - this.$chat.children().last().append(' <button name="toggleMessages" value="' + user + '" class="subtle"><small>(' + $messages.length + ' line' + ($messages.length > 1 ? 's' : '') + ' from ' + user + ' hidden)</small></button>'); + if (this.rankOrder[app.user.get('name').charAt(0)] > 3) this.$chat.children().last().append(' <button name="toggleMessages" value="' + user + '" class="subtle"><small>(' + $messages.length + ' line' + ($messages.length > 1 ? 's' : '') + ' from ' + user + ' hidden)</small></button>'); } break;