diff --git a/commands/core/join.js b/commands/core/join.js index 81e154d..b4b2364 100644 --- a/commands/core/join.js +++ b/commands/core/join.js @@ -151,6 +151,11 @@ export async function run({ // socket.channels.push(channel); socket.channels = [channel]; + // global mod perks + if (isModerator(socket.level)) { + socket.ratelimitImmune = true; + } + nicks.push(userInfo.nick); /* @legacy */ users.push({ ...{ isme: true, isBot: socket.isBot }, ...userInfo }); diff --git a/commands/core/session.js b/commands/core/session.js index 5be594a..58e965b 100644 --- a/commands/core/session.js +++ b/commands/core/session.js @@ -12,6 +12,7 @@ import fs from 'fs'; import jsonwebtoken from 'jsonwebtoken'; import { + isModerator, verifyNickname, } from '../utility/_UAC.js'; import { @@ -140,6 +141,11 @@ export async function run({ socket.muzzled = session.muzzled; socket.banned = session.banned; + // global mod perks + if (isModerator(socket.level)) { + socket.ratelimitImmune = true; + } + socket.hash = server.getSocketHash(socket); socket.hcProtocol = 2; diff --git a/commands/mod/lockroom.js b/commands/mod/lockroom.js index d2eb10c..c27d612 100644 --- a/commands/mod/lockroom.js +++ b/commands/mod/lockroom.js @@ -9,7 +9,6 @@ */ import { - levels, isTrustedUser, isModerator, verifyNickname, @@ -173,7 +172,7 @@ export function chatCheck({ socket, payload, }) { if (socket.channel === 'purgatory') { - if (socket.level >= levels.moderator) { + if (isModerator(socket.level)) { return payload; }