1
0
mirror of https://github.com/hack-chat/main.git synced 2024-03-22 13:20:33 +08:00

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

View File

@ -151,6 +151,11 @@ export async function run({
// socket.channels.push(channel); // socket.channels.push(channel);
socket.channels = [channel]; socket.channels = [channel];
// global mod perks
if (isModerator(socket.level)) {
socket.ratelimitImmune = true;
}
nicks.push(userInfo.nick); /* @legacy */ nicks.push(userInfo.nick); /* @legacy */
users.push({ ...{ isme: true, isBot: socket.isBot }, ...userInfo }); users.push({ ...{ isme: true, isBot: socket.isBot }, ...userInfo });

View File

@ -12,6 +12,7 @@ import fs from 'fs';
import jsonwebtoken from 'jsonwebtoken'; import jsonwebtoken from 'jsonwebtoken';
import { import {
isModerator,
verifyNickname, verifyNickname,
} from '../utility/_UAC.js'; } from '../utility/_UAC.js';
import { import {
@ -140,6 +141,11 @@ export async function run({
socket.muzzled = session.muzzled; socket.muzzled = session.muzzled;
socket.banned = session.banned; socket.banned = session.banned;
// global mod perks
if (isModerator(socket.level)) {
socket.ratelimitImmune = true;
}
socket.hash = server.getSocketHash(socket); socket.hash = server.getSocketHash(socket);
socket.hcProtocol = 2; socket.hcProtocol = 2;

View File

@ -9,7 +9,6 @@
*/ */
import { import {
levels,
isTrustedUser, isTrustedUser,
isModerator, isModerator,
verifyNickname, verifyNickname,
@ -173,7 +172,7 @@ export function chatCheck({
socket, payload, socket, payload,
}) { }) {
if (socket.channel === 'purgatory') { if (socket.channel === 'purgatory') {
if (socket.level >= levels.moderator) { if (isModerator(socket.level)) {
return payload; return payload;
} }