Move shadow ban list to public db

Warning: Migration is not automatic
This commit is contained in:
Ajay Ramachandran
2021-06-20 13:41:35 -04:00
parent f45241d494
commit 48d88614fb
10 changed files with 35 additions and 26 deletions

View File

@@ -404,7 +404,7 @@ export async function voteOnSponsorTime(req: Request, res: Response) {
const ableToVote = isVIP
|| (!(isOwnSubmission && incrementAmount > 0)
&& (await db.prepare("get", `SELECT "userID" FROM "sponsorTimes" WHERE "userID" = ?`, [nonAnonUserID])) !== undefined
&& (await privateDB.prepare("get", `SELECT "userID" FROM "shadowBannedUsers" WHERE "userID" = ?`, [nonAnonUserID])) === undefined
&& (await db.prepare("get", `SELECT "userID" FROM "shadowBannedUsers" WHERE "userID" = ?`, [nonAnonUserID])) === undefined
&& (await privateDB.prepare("get", `SELECT "UUID" FROM "votes" WHERE "UUID" = ? AND "hashedIP" = ? AND "userID" != ?`, [UUID, hashedIP, userID])) === undefined)
&& !finalResponse.blockVote
&& finalResponse.finalStatus === 200;