added mod perks

This commit is contained in:
marzavec
2023-12-27 00:38:18 -08:00
parent 61c0be77d5
commit 2a5a9c150c
3 changed files with 12 additions and 2 deletions
+5
View File
@@ -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 });
+6
View File
@@ -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;
+1 -2
View File
@@ -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;
}