From 91be717a1a5f2d68591b6202b6857d9a34761937 Mon Sep 17 00:00:00 2001 From: Hri7566 Date: Mon, 12 Apr 2021 18:19:16 -0400 Subject: [PATCH] admin chset --- src/Message.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Message.js b/src/Message.js index eefc277..3fbf5e5 100644 --- a/src/Message.js +++ b/src/Message.js @@ -111,10 +111,12 @@ module.exports = (cl) => { } }); - cl.on("chset", msg => { + cl.on("chset", (msg, admin) => { if (!(cl.channel && cl.participantId)) return; - if (!cl.channel.crown) return; - if (!(cl.user._id == cl.channel.crown.userId)) return; + if (!cl.channel.crown && !admin) return; + if (!admin) { + if (!(cl.user._id == cl.channel.crown.userId)) return; + } if (!msg.hasOwnProperty("set") || !msg.set) msg.set = new RoomSettings(cl.channel.settings, 'user'); cl.channel.settings.changeSettings(msg.set); cl.channel.updateCh();