From e17dac58fd2230016df0e05ff7a0649bda6833f4 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Wed, 24 Aug 2016 20:03:30 -0700 Subject: [PATCH] Add a temp bypass for initial rollout --- src/channel/chat.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/channel/chat.js b/src/channel/chat.js index 4637cd19..b0424faf 100644 --- a/src/channel/chat.js +++ b/src/channel/chat.js @@ -121,7 +121,17 @@ ChatModule.prototype.shadowMutedUsers = function () { }); }; +const SERVER_START_DATE = Date.now(); ChatModule.prototype.restrictNewAccount = function restrictNewAccount(user, data) { + // TODO: this is temporary to prevent hundreds of guests from getting + // blocked immediately after this feature is rolled out. + // + // Will be removed later. + if (SERVER_START_DATE + this.channel.modules.options.get("new_user_chat_delay")*1000 + >= Date.now()) { + return false; + } + if (user.account.effectiveRank < 2 && this.channel.modules.options) { const firstSeen = user.getFirstSeenTime(); const opts = this.channel.modules.options;