77 lines
4.2 KiB
TypeScript
77 lines
4.2 KiB
TypeScript
/* Metro module 6894; source: utils/ReportUtils.tsx; dependencies: [1379, 4111, 3784, 1878, 661, 2] */
|
|
import ChannelStore from '../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import UserStore from '../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import PermissionStore from '../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
|
|
import GuildMemberCountStore from '../stores/GuildMemberCountStore.tsx'; /* Metro dependency 4111 */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
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 canReportUser2 = canReportUser;
|
|
const canReportMessage2 = canReportMessage;
|
|
const canReportAndDeleteInChannel2 = canReportAndDeleteInChannel;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('utils/ReportUtils.tsx');
|
|
exports.canReportUser = canReportUser2;
|
|
exports.canReportMessage = canReportMessage2;
|
|
exports.canReportAndDeleteInChannel = canReportAndDeleteInChannel2;
|
|
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 guildMemberCountStoreBinding;
|
|
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 permissionStoreBinding = PermissionStore;
|
|
var canWithPartialContext = permissionStoreBinding.canWithPartialContext;
|
|
var MANAGE_MESSAGES = Permissions.MANAGE_MESSAGES;
|
|
if (Reflect.apply(canWithPartialContext, permissionStoreBinding, [MANAGE_MESSAGES, {channelId: a0}])) {
|
|
guildMemberCountStoreBinding = GuildMemberCountStore;
|
|
value = guildMemberCountStoreBinding.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;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun54740, 6894, [1379, 4111, 3784, 1878, 661,
|
|
2]) /* metro module 6894, dependencies: [1379, 4111, 3784, 1878, 661, 2] */;
|