admin chset
This commit is contained in:
parent
1802c436fc
commit
13a89f76a9
|
@ -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 && cl.participantId)) return;
|
||||||
if (!cl.channel.crown) return;
|
if (!cl.channel.crown && !admin) return;
|
||||||
if (!(cl.user._id == cl.channel.crown.userId)) 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');
|
if (!msg.hasOwnProperty("set") || !msg.set) msg.set = new RoomSettings(cl.channel.settings, 'user');
|
||||||
cl.channel.settings.changeSettings(msg.set);
|
cl.channel.settings.changeSettings(msg.set);
|
||||||
cl.channel.updateCh();
|
cl.channel.updateCh();
|
||||||
|
|
Loading…
Reference in New Issue