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:
parent
61c0be77d5
commit
2a5a9c150c
|
@ -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 });
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user