decord/alpha/source/modules/messages/isSpam.tsx

47 lines
1.2 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 06:59:38 +00:00
// Module ID: 7229
// Function ID: 7230
// Name: isSpam
2026-10-12 06:59:38 +00:00
// Dependencies: [1390, 1085, 7230, 2]
2026-07-29 08:29:29 +00:00
// Exports: isSpam, isSpamSupported, isSpammer
2026-07-20 16:05:17 +00:00
2026-10-12 06:59:38 +00:00
// Module 7229 (isSpam)
import AutomodMessageUtils from "AutomodMessageUtils" /* 7230 */;
2026-10-09 10:00:15 +00:00
import UserStore from "UserStore" /* 1390 */;
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
let c3;
let closure_4;
({ UserFlags: c3, ChannelTypes: closure_4 } = Constants);
const result = size.fileFinishedImporting("modules/messages/isSpam.tsx");
2026-07-20 16:05:17 +00:00
export const isSpamSupported = function isSpamSupported(type) {
2026-10-03 08:58:59 +00:00
return undefined !== type && type.type !== constants2.DM;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const isSpammer = function isSpammer(userId) {
const user = UserStore.getUser(userId);
2026-07-29 08:29:29 +00:00
let flag;
if (user != null) {
flag = user.hasFlag(constants.SPAMMER);
}
if (flag == null) {
flag = false;
}
return flag;
};
2026-07-20 16:05:17 +00:00
export const isSpam = function isSpam(author) {
const user = UserStore.getUser(author.author.id);
2026-07-29 08:29:29 +00:00
let flag;
if (user != null) {
flag = user.hasFlag(constants.SPAMMER);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (flag == null) {
flag = false;
}
if (flag) {
2026-10-03 08:58:59 +00:00
const obj2 = AutomodMessageUtils;
flag = !obj2.isAutomodMessageRecord(author);
2026-07-29 08:29:29 +00:00
}
return flag;
2026-07-20 16:05:17 +00:00
};