Files
discord-decomp/sources/modules/guild_onboarding/DefaultChannelUtils.tsx
T
2026-07-28 01:06:53 +03:00

69 lines
4.0 KiB
TypeScript

/* Metro module 5108; source: modules/guild_onboarding/DefaultChannelUtils.tsx; dependencies: [1936, 1379, 661, 483, 566, 3789, 2] */
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import GatedChannelStore from '../channel/GatedChannelStore.tsx'; /* Metro dependency 1936 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
function _fun44630(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#44630, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5286:6, offset: 0x01175a90, size: 189 bytes, params: 8, frame: 19
let env0_0 = require;
const getDefaultPermissionsForChannel = function(a0) {
return a0 == null ? Permissions.VIEW_CHANNEL : ChannelTypesSets.GUILD_VOCAL.has(a0.type) ? importAll(dependencyMap[3]).combine(Permissions.VIEW_CHANNEL,
Permissions.CONNECT) : Permissions.VIEW_CHANNEL;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/guild_onboarding/DefaultChannelUtils.tsx');
exports.useCanChannelBeDefault = function(a0, a1) {
var env0_0 = a0;
var env0_1 = a1;
return require(dependencyMap[4]).useStateFromStores([GatedChannelStore, ChannelStore], _fun44633);
};
exports.canChannelBeDefault = canChannelBeDefault;
function useCanChannelBeDefault(a0, a1) { // fn#44632, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5286:413, offset: 0x01175bbc, size: 79 bytes, params: 3, frame: 15
const env0_0 = a0;
const env0_1 = a1;
return (FluxModule).useStateFromStores([GatedChannelStore, ChannelStore],
_fun44633);
function _fun44633() { // fn#44633, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5286:491, offset: 0x01175c0b, size: 92 bytes, params: 1, frame: 17
var r0;
let value = environment.__proto__;
const channel = ChannelStore.getChannel(require);
const defaultPermissionsForChannel = getDefaultPermissionsForChannel(channel);
const isChannelGated2 = GatedChannelStore.isChannelGated(env0_0, require);
if (isChannelGated2) {
r0 = isChannelGated2;
} else {
value = importAll(3789) /* metro dependency 3789: PermissionUtils */;
value = value.canEveryoneRole(defaultPermissionsForChannel, channel);
r0 = value;
}
return r0;
}
}
function canChannelBeDefault(a0, a1) { // fn#44634, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5286:640, offset: 0x01175c67, size: 101 bytes, params: 3, frame: 17
var r0;
var moduleValue;
var canEveryoneRole;
const defaultPermissionsForChannel = getDefaultPermissionsForChannel(ChannelStore.getChannel(a1));
const isChannelGated2 = GatedChannelStore.isChannelGated(a0, a1);
if (isChannelGated2) {
r0 = isChannelGated2;
} else {
moduleValue = importAll(3789) /* metro dependency 3789: PermissionUtils */;
canEveryoneRole = moduleValue.canEveryoneRole;
channelStoreBinding = ChannelStore;
r0 = Reflect.apply(canEveryoneRole, moduleValue, [defaultPermissionsForChannel,
channelStoreBinding.getChannel(a1)]);
}
return r0;
}
}
global.__d(_fun44630, 5108, [1936, 1379, 661, 483, 566, 3789,
2]) /* metro module 5108, dependencies: [1936, 1379, 661, 483, 566, 3789, 2] */;