148 lines
6.8 KiB
TypeScript
148 lines
6.8 KiB
TypeScript
/* Metro module 9142; source: modules/guild_scheduled_events/StartEventUtils.tsx; dependencies: [5, 1383, 1379, 1867, 1385, 661, 9086, 44, 8123, 9037, 2] */
|
|
function _fun71613(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#71613, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9327:6, offset: 0x01d26a0d, size: 310 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const closure = function() {
|
|
return _createStageChannelForEvent.apply(this, arguments);
|
|
};
|
|
const closure2 = findOrCreateEventChannel;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_4 = (require(1383) /* metro dependency 1383: ChannelRecord */).createChannelRecordFromServer;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const guildScheduledEventsConstantsModule = require(1385) /* metro dependency 1385: GuildScheduledEventsConstants */;
|
|
const env0_7 = guildScheduledEventsConstantsModule.GuildScheduledEventEntityTypes;
|
|
const env0_8 = guildScheduledEventsConstantsModule.GuildScheduledEventPrivacyLevel;
|
|
const env0_9 = (require(661) /* metro dependency 661: Constants */).ChannelTypes;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_scheduled_events/StartEventUtils.tsx');
|
|
exports.createStageChannelForEvent = closure;
|
|
exports.findOrCreateEventChannel = closure2;
|
|
exports.preStartEventActions = function() {
|
|
return _preStartEventActions.apply(this, arguments);
|
|
};
|
|
exports.setEventAsActive = function() {
|
|
return _setEventAsActive.apply(this, arguments);
|
|
};
|
|
}
|
|
|
|
function _createStageChannelForEvent() { // fn#71615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9327:365, offset: 0x01d26b43, size: 50 bytes, params: 1, frame: 14
|
|
return env0_3(_fun71617).apply(this, arguments);
|
|
}
|
|
|
|
function findOrCreateEventChannel(a0, a1) { // fn#71618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9327:726, offset: 0x01d26c88, size: 118 bytes, params: 3, frame: 17
|
|
const guild_id = a0.guild_id;
|
|
const channel_id = a0.channel_id;
|
|
const guild = GuildStore.getGuild(guild_id);
|
|
if (guild == null) {
|
|
return global.Promise.resolve(null);
|
|
}
|
|
const channel = ChannelStore.getChannel(channel_id);
|
|
return channel == null ? createStageChannelForEvent(guild, a0.name, a1) : global.Promise.resolve(channel);
|
|
}
|
|
|
|
function _preStartEventActions() { // fn#71619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9327:948, offset: 0x01d26cfe, size: 50 bytes, params: 1, frame: 14
|
|
return env0_3(_fun71621).apply(this, arguments);
|
|
}
|
|
|
|
function _setEventAsActive() { // fn#71622, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9327:1186, offset: 0x01d26da6, size: 50 bytes, params: 1, frame: 14
|
|
return env0_3(_fun71624).apply(this, arguments);
|
|
}
|
|
|
|
async function _fun71617({id}, a1) { // fn#71617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9327:442, offset: 0x01d26b89, size: 255 bytes, params: 3, frame: 22
|
|
let value = a2;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
const r4 = value !== undefined ? value : [];
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
const items3 = [];
|
|
const push = items3.push;
|
|
const items2 = [];
|
|
arraySpread(items2, r4, 0, a1);
|
|
apply(push, items2, items3, a1);
|
|
value = environment.__proto__.__proto__;
|
|
const value5 = env2_1(env2_2[6]);
|
|
const createChannel = value5.createChannel;
|
|
const object2 = {};
|
|
object2.guildId = id;
|
|
const GUILD_STAGE_VOICE = env2_9.GUILD_STAGE_VOICE;
|
|
object2.type = GUILD_STAGE_VOICE;
|
|
object2.name = a1.substring(0, 100);
|
|
object2.permissionOverwrites = items3;
|
|
await Reflect.apply(createChannel, value5, [object2]);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
if (null == undefined) {
|
|
throw new global.Error("Can't create channel for event");
|
|
}
|
|
if (undefined.status !== 201) {
|
|
throw new global.Error("Can't create channel for event");
|
|
}
|
|
return env2_4(undefined.body);
|
|
}
|
|
|
|
function* _fun71621(a0, a1) { // fn#71621, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9327:1013, offset: 0x01d26d3b, size: 107 bytes, params: 3, frame: 15
|
|
if (true) {
|
|
var entity_type = a0.entity_type;
|
|
value = environment.__proto__.__proto__;
|
|
var STAGE_INSTANCE = env2_7.STAGE_INSTANCE;
|
|
if (entity_type === STAGE_INSTANCE) {
|
|
yield env2_12(a0, a1);
|
|
var value3 = undefined;
|
|
if (false) {
|
|
return value3;
|
|
}
|
|
env2_1(env2_2[7])(value3 != null, 'could not find or create channel');
|
|
}
|
|
}
|
|
}
|
|
|
|
async function _fun71624({channel_id, entity_type, name, id, guild_id}) { // fn#71624, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9327:1243, offset: 0x01d26dec, size: 348 bytes, params: 2, frame: 26
|
|
var binding;
|
|
var binding2;
|
|
var binding3;
|
|
var value8;
|
|
let value = a1;
|
|
if (true) {
|
|
var r9 = value !== undefined ? value : false;
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
var STAGE_INSTANCE = env2_7.STAGE_INSTANCE;
|
|
if (STAGE_INSTANCE === entity_type) {
|
|
binding = env2_1;
|
|
binding3 = env2_2;
|
|
binding(binding3[7])(channel_id != null, 'channel_id is required');
|
|
binding = env2_0;
|
|
value8 = binding(binding3[8]);
|
|
await value8.startStageInstance(channel_id, name, env2_8.GUILD_ONLY, r9, id);
|
|
} else {
|
|
var VOICE = env2_7.VOICE;
|
|
if (VOICE === entity_type) {
|
|
binding = env2_1;
|
|
binding2 = env2_2;
|
|
value = binding(binding2[7]);
|
|
value(channel_id != null, 'channel_id is required');
|
|
value = binding(binding2[9]);
|
|
await value.startEvent(id, guild_id);
|
|
value = undefined;
|
|
return undefined;
|
|
}
|
|
var EXTERNAL = env2_7.EXTERNAL;
|
|
if (EXTERNAL !== entity_type) {
|
|
return undefined;
|
|
}
|
|
value = env2_1(env2_2[9]);
|
|
await value.startEvent(id, guild_id);
|
|
}
|
|
}
|
|
}
|
|
|