Files
discord-decomp/sources/utils/ReportUtils.tsx
T
2026-07-27 16:20:00 +03:00

72 lines
3.6 KiB
TypeScript

/* Metro module 6894; source: utils/ReportUtils.tsx; dependencies: [1379, 4111, 3784, 1878, 661, 2] */
function _fun54740(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7072:6, offset: 0x0136d164, size: 233 bytes, params: 8, frame: 22
const closure = canReportUser;
const closure2 = canReportMessage;
const closure3 = canReportAndDeleteInChannel;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildMemberCountStore = importDefault(4111) /* metro dependency 4111: GuildMemberCountStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_4 = constantsModule.ChannelTypes;
const env0_5 = constantsModule.Permissions;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ReportUtils.tsx');
exports.canReportUser = closure;
exports.canReportMessage = closure2;
exports.canReportAndDeleteInChannel = closure3;
exports.canDeleteAndReportMessage = canDeleteAndReportMessage;
}
function canReportUser(a0) { // fn#54741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7072:179, offset: 0x0136d24d, size: 70 bytes, params: 2, frame: 12
if (a0 == null) {
return false;
}
const id = a0.id;
const currentUser = UserStore.getCurrentUser();
return currentUser != null && (currentUser.id !== id && a0.system !== true);
}
function canReportMessage(a0) { // fn#54742, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7072:299, offset: 0x0136d293, size: 34 bytes, params: 2, frame: 12
return a0 != null && canReportUser(a0.author);
}
function canReportAndDeleteInChannel(a0) { // fn#54743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7072:368, offset: 0x0136d2b5, size: 155 bytes, params: 2, frame: 17
var value;
const channel = ChannelStore.getChannel(a0);
if (channel != null) {
var type = channel.type;
var DM = ChannelTypes.DM;
if (type === DM) {
return true;
}
type = channel.type;
var GROUP_DM = ChannelTypes.GROUP_DM;
if (type === GROUP_DM) {
return true;
}
var canWithPartialContext = PermissionStore.canWithPartialContext;
var MANAGE_MESSAGES = Permissions.MANAGE_MESSAGES;
if (Reflect.apply(canWithPartialContext, PermissionStore, [MANAGE_MESSAGES, {channelId: a0}])) {
value = GuildMemberCountStore.getMemberCount(channel.getGuildId());
return value != null && value >= 50;
}
}
return false;
}
function canDeleteAndReportMessage(a0) { // fn#54744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7072:835, offset: 0x0136d350, size: 55 bytes, params: 2, frame: 12
var canReportAndDeleteInChannelBinding;
let value = a0 != null;
let r0 = value && canReportMessage(a0);
if (r0) {
canReportAndDeleteInChannelBinding = canReportAndDeleteInChannel;
value = a0.getChannelId();
value = canReportAndDeleteInChannelBinding(value);
r0 = value;
}
return r0;
}