mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-19 22:18:35 +03:00
Move getVoteAuthor to webhookUtils and move user status (api) to webhookUtils
This commit is contained in:
26
src/utils/webhookUtils.js
Normal file
26
src/utils/webhookUtils.js
Normal file
@@ -0,0 +1,26 @@
|
||||
function getVoteAuthorRaw(submissionCount, isVIP, isOwnSubmission) {
|
||||
if (isOwnSubmission) {
|
||||
return "self";
|
||||
} else if (isVIP) {
|
||||
return "vip";
|
||||
} else if (submissionCount === 0) {
|
||||
return "new";
|
||||
} else {
|
||||
return "other";
|
||||
};
|
||||
};
|
||||
|
||||
function getVoteAuthor(submissionCount, isVIP, isOwnSubmission) {
|
||||
if (submissionCount === 0) {
|
||||
return "Report by New User";
|
||||
} else if (isVIP) {
|
||||
return "Report by VIP User";
|
||||
} else if (isOwnSubmission) {
|
||||
return "Report by Submitter";
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
module.exports.getVoteAuthorRaw = getVoteAuthorRaw;
|
||||
module.exports.getVoteAuthor = getVoteAuthor;
|
||||
Reference in New Issue
Block a user