2026-09-22 22:11:40 +00:00
|
|
|
// Module ID: 7610
|
|
|
|
|
// Function ID: 7611
|
2026-09-18 20:18:48 +00:00
|
|
|
// Name: isSpam
|
2026-09-22 22:11:40 +00:00
|
|
|
// Dependencies: [1371, 1074, 7611, 2]
|
2026-09-18 20:18:48 +00:00
|
|
|
// Exports: isSpam, isSpamSupported, isSpammer
|
|
|
|
|
|
2026-09-22 22:11:40 +00:00
|
|
|
// Module 7610 (isSpam)
|
|
|
|
|
import AutomodMessageUtils from "AutomodMessageUtils" /* 7611 */;
|
2026-09-18 20:18:48 +00:00
|
|
|
import UserStore from "UserStore" /* 1371 */;
|
|
|
|
|
|
|
|
|
|
require = fn;
|
|
|
|
|
const Constants = fn(1074);
|
|
|
|
|
({ UserFlags: c3, ChannelTypes: closure_4 } = Constants);
|
|
|
|
|
const size = fn(2);
|
|
|
|
|
const result = size.fileFinishedImporting("modules/messages/isSpam.tsx");
|
|
|
|
|
|
|
|
|
|
export const isSpamSupported = function isSpamSupported(type) {
|
|
|
|
|
let tmp = undefined !== type;
|
|
|
|
|
if (tmp) {
|
|
|
|
|
tmp = type.type !== constants2.DM;
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
};
|
|
|
|
|
export const isSpammer = function isSpammer(userId) {
|
|
|
|
|
const user = UserStore.getUser(userId);
|
|
|
|
|
let flag;
|
|
|
|
|
if (user != null) {
|
|
|
|
|
flag = user.hasFlag(constants.SPAMMER);
|
|
|
|
|
}
|
|
|
|
|
if (flag == null) {
|
|
|
|
|
flag = false;
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
};
|
|
|
|
|
export const isSpam = function isSpam(author) {
|
|
|
|
|
const user = UserStore.getUser(author.author.id);
|
|
|
|
|
let flag;
|
|
|
|
|
if (user != null) {
|
|
|
|
|
flag = user.hasFlag(constants.SPAMMER);
|
|
|
|
|
}
|
|
|
|
|
if (flag == null) {
|
|
|
|
|
flag = false;
|
|
|
|
|
}
|
|
|
|
|
if (flag) {
|
|
|
|
|
flag = !AutomodMessageUtils.isAutomodMessageRecord(author);
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
};
|