From 263c89fef51871a94d10cc08f48f0a597c38e353 Mon Sep 17 00:00:00 2001 From: HF Date: Sun, 11 Jun 2023 19:17:18 +0200 Subject: [PATCH] fix userid < 5000 special chat priviledge --- src/core/ChatProvider.js | 2 +- src/data/redis/chat.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/ChatProvider.js b/src/core/ChatProvider.js index e0a8b3e..80dc734 100644 --- a/src/core/ChatProvider.js +++ b/src/core/ChatProvider.js @@ -424,7 +424,7 @@ export class ChatProvider { channelId, id, user.ipSub, - (id > 5000) ? country : 'nope', + country, ); if (allowed) { logger.info( diff --git a/src/data/redis/chat.js b/src/data/redis/chat.js index 4a9a318..a60e9d4 100644 --- a/src/data/redis/chat.js +++ b/src/data/redis/chat.js @@ -16,15 +16,15 @@ export async function allowedChat( ip, cc, ) { - if (!cc || cc.length !== 2) { - return [0, 0]; - } const mutecKey = `${MUTEC_PREFIX}:${channelId}`; const muteKey = `${MUTE_PREFIX}:${userId}`; const isalKey = `${ALLOWED_PREFIX}:${ip}`; + const country = (cc?.length !== 2 || userId < 5000) ? 'nope' : cc; return client.allowedChat( - mutecKey, muteKey, isalKey, - cc, + mutecKey, + muteKey, + isalKey, + country, ); }