mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2024-11-10 01:02:30 +01:00
Merge branch 'master' of https://github.com/ajayyy/SponsorBlockServer
This commit is contained in:
commit
9dd8b28812
4 changed files with 5 additions and 5 deletions
|
@ -179,7 +179,7 @@ async function checkUserActiveWarning(userID: HashedUserID): Promise<CheckResult
|
|||
|
||||
return {
|
||||
pass: false,
|
||||
errorMessage: defaultMessage + (warnings[0]?.reason?.length > 0 ? `\n\nWarning reason: '${warnings[0].reason}'` : ""),
|
||||
errorMessage: defaultMessage + (warnings[0]?.reason?.length > 0 ? `\n\nTip message: '${warnings[0].reason}'` : ""),
|
||||
errorCode: 403
|
||||
};
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ export async function postWarning(req: Request, res: Response): Promise<Response
|
|||
"run", 'UPDATE "warnings" SET "enabled" = 1, "reason" = ? WHERE "userID" = ? AND "issueTime" = ?',
|
||||
[reason, userID, previousWarning.issueTime]
|
||||
);
|
||||
resultStatus = "re-enabled";
|
||||
resultStatus = "re-enabled for";
|
||||
} else {
|
||||
return res.sendStatus(409);
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ export async function postWarning(req: Request, res: Response): Promise<Response
|
|||
}
|
||||
|
||||
return res.status(200).json({
|
||||
message: `Warning ${resultStatus} user '${userID}'.`,
|
||||
message: `Tip ${resultStatus} user '${userID}'.`,
|
||||
});
|
||||
} catch (e) {
|
||||
Logger.error(e as string);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue