From 803fc18554128bea1755a28e1fd91ca7b4eefa09 Mon Sep 17 00:00:00 2001 From: Ajay Date: Fri, 16 Aug 2024 00:36:42 -0400 Subject: [PATCH] Verify old submissions right after someone votes on it --- src/routes/postBranding.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/routes/postBranding.ts b/src/routes/postBranding.ts index 1cccfea..072e51d 100644 --- a/src/routes/postBranding.ts +++ b/src/routes/postBranding.ts @@ -253,6 +253,13 @@ async function updateVoteTotals(type: BrandingType, UUID: BrandingUUID, userID: } } else { await db.prepare("run", `UPDATE ${table} SET "votes" = "votes" + 1 WHERE "UUID" = ?`, [UUID]); + + if (type === BrandingType.Title) { + const votedSubmitterUserID = (await db.prepare("get", `SELECT "userID" FROM ${table2} WHERE "UUID" = ?`, [UUID]))?.userID; + if (votedSubmitterUserID) { + await verifyOldSubmissions(votedSubmitterUserID, await getVerificationValue(votedSubmitterUserID, await isUserVIP(votedSubmitterUserID))); + } + } } if (shouldLock) {