From d18a4a13f200aa00bcb0622a7c0921859ae618ae Mon Sep 17 00:00:00 2001 From: Ajay Date: Thu, 10 Apr 2025 12:47:32 -0400 Subject: [PATCH] Check dearrow vote history for new submitters --- src/utils/permissions.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/utils/permissions.ts b/src/utils/permissions.ts index aca30a9..28f8d11 100644 --- a/src/utils/permissions.ts +++ b/src/utils/permissions.ts @@ -58,6 +58,14 @@ async function oldDeArrowSubmitterOrAllowed(userID: HashedUserID): Promise= 1; if (!isOldSubmitter) { + if (!submitterThreshold) { + const voteResult = await db.prepare("get", `SELECT "UUID" from "titleVotes" where "userID" = ?`, [userID], { useReplica: true }); + if (voteResult?.UUID) { + // Count at least one vote as an old submitter as well + return true; + } + } + await redis.zRemRangeByScore("submittersDeArrow", "-inf", Date.now() - fiveMinutes); const last5MinUsers = await redis.zCard("submittersDeArrow");