From 7196155d3a4db3e3a2854c2bc725bbb16f23ddf7 Mon Sep 17 00:00:00 2001 From: mini-bomba <55105495+mini-bomba@users.noreply.github.com> Date: Sat, 16 Sep 2023 10:00:33 +0200 Subject: [PATCH] Replace "Warning reason" with "Tip message" --- src/routes/postSkipSegments.ts | 2 +- src/routes/voteOnSponsorTime.ts | 2 +- test/cases/postSkipSegmentsWarnings.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/routes/postSkipSegments.ts b/src/routes/postSkipSegments.ts index ee4a459..61ccc67 100644 --- a/src/routes/postSkipSegments.ts +++ b/src/routes/postSkipSegments.ts @@ -179,7 +179,7 @@ async function checkUserActiveWarning(userID: HashedUserID): Promise 0 ? `\n\nWarning reason: '${warnings[0].reason}'` : ""), + errorMessage: defaultMessage + (warnings[0]?.reason?.length > 0 ? `\n\nTip message: '${warnings[0].reason}'` : ""), errorCode: 403 }; } diff --git a/src/routes/voteOnSponsorTime.ts b/src/routes/voteOnSponsorTime.ts index bc3728c..9c9fe2e 100644 --- a/src/routes/voteOnSponsorTime.ts +++ b/src/routes/voteOnSponsorTime.ts @@ -384,7 +384,7 @@ export async function vote(ip: IPAddress, UUID: SegmentUUID, paramUserID: UserID lock.unlock(); return { status: 403, message: "Vote rejected due to a tip from a moderator. This means that we noticed you were making some common mistakes that are not malicious, and we just want to clarify the rules. " + "Could you please send a message in Discord or Matrix so we can further help you?" + - `${(warningReason.length > 0 ? ` Warning reason: '${warningReason}'` : "")}` }; + `${(warningReason.length > 0 ? ` Tip message: '${warningReason}'` : "")}` }; } // we can return out of the function early if the user is banned after warning checks diff --git a/test/cases/postSkipSegmentsWarnings.ts b/test/cases/postSkipSegmentsWarnings.ts index 209b425..2af7a56 100644 --- a/test/cases/postSkipSegmentsWarnings.ts +++ b/test/cases/postSkipSegmentsWarnings.ts @@ -63,7 +63,7 @@ describe("postSkipSegments Warnings", () => { const expected = "Submission rejected due to a tip from a moderator. This means that we noticed you were making some common mistakes" + " that are not malicious, and we just want to clarify the rules. " + "Could you please send a message in discord.gg/SponsorBlock or matrix.to/#/#sponsor:ajay.app so we can further help you? " - + `Your userID is ${warnUser01Hash}.\n\nWarning reason: '${reason}'`; + + `Your userID is ${warnUser01Hash}.\n\nTip message: '${reason}'`; assert.strictEqual(errorMessage, expected); done();