From 3bc113b3a5fe4cc51169702cdee6285dff70546f Mon Sep 17 00:00:00 2001 From: Charlie Kobayashi Date: Wed, 10 Oct 2018 12:48:25 -0400 Subject: [PATCH] Scavengers: make queue public (#4901) --- chat-plugins/scavengers.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chat-plugins/scavengers.js b/chat-plugins/scavengers.js index 5349819fb3..3e062a5a77 100644 --- a/chat-plugins/scavengers.js +++ b/chat-plugins/scavengers.js @@ -176,6 +176,7 @@ let HostLeaderboard = new PlayerLadder(HOST_DATA_FILE); let PlayerLeaderboard = new PlayerLadder(PLAYER_DATA_FILE); function formatQueue(queue = [], viewer, room) { + const isStaff = viewer.can('mute', null, room); const queueDisabled = room.scavQueueDisabled; const timerDuration = room.defaultScavTimer || DEFAULT_TIMER_DURATION; let buffer; @@ -184,7 +185,9 @@ function formatQueue(queue = [], viewer, room) { } else { buffer = `The scavenger queue is currently empty.`; } - return `
${buffer}
ByQuestions
Auto Timer Duration: ${timerDuration} minutesAuto Dequeue:  
`; + let template = `
${isStaff ? buffer : buffer.replace(/.+?<\/button>/gi, '')}
ByQuestions
`; + if (isStaff) template += `
Auto Timer Duration: ${timerDuration} minutesAuto Dequeue:  
`; + return template; } function formatOrder(place) { @@ -1044,7 +1047,6 @@ let commands = { viewqueue: function (target, room, user) { if (room.id !== 'scavengers') return this.errorReply("This command can only be used in the scavengers room."); - if (!this.can('mute', null, room)) return false; this.sendReply(`|uhtml|scav-queue|${formatQueue(room.scavQueue, user, room)}`); },