123 lines
7.0 KiB
TypeScript
123 lines
7.0 KiB
TypeScript
/* Metro module 9086; source: actions/CreateChannelActionCreators.tsx; dependencies: [4864, 661, 670, 694, 5046, 480, 1392, 6613, 6610, 6931, 2] */
|
|
function _fun71006(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#71006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9271:6, offset: 0x01d11e04, size: 201 bytes, params: 8, frame: 19
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const userGuildSettingsStore = importDefault(4864) /* metro dependency 4864: UserGuildSettingsStore */;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_4 = constantsModule.BITRATE_DEFAULT;
|
|
const env0_5 = constantsModule.ChannelTypes;
|
|
const env0_6 = constantsModule.Endpoints;
|
|
const env0_7 = (require(670) /* metro dependency 670: UserSettingsConstants */).ChannelNotificationSettingsFlags;
|
|
object2 = {createChannel: createChannel,
|
|
createRoleSubscriptionTemplateChannel: createRoleSubscriptionTemplateChannel};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('actions/CreateChannelActionCreators.tsx');
|
|
exports.default = object2;
|
|
}
|
|
|
|
function createChannel({guildId, type, name, permissionOverwrites = [], bitrate, userLimit, parentId, skuId, branchId, flags, availableTags}) { // fn#71007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9271:213, offset: 0x01d11ecd, size: 482 bytes, params: 2, frame: 27
|
|
var object4;
|
|
var defaultImport2;
|
|
var post;
|
|
var object3;
|
|
const NetworkActionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).NetworkActionNames;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CREATE_CHANNEL_MODAL_SUBMIT',
|
|
guildId: guildId, channelType: type});
|
|
object4 = {type: type, name: name, permission_overwrites: permissionOverwrites};
|
|
if (bitrate != null && bitrate !== BITRATE_DEFAULT) {
|
|
object4.bitrate = bitrate;
|
|
}
|
|
if (userLimit != null && userLimit > 0) {
|
|
object4.user_limit = userLimit;
|
|
}
|
|
if (parentId != null) {
|
|
object4.parent_id = parentId;
|
|
}
|
|
if (flags != null) {
|
|
object4.flags = flags;
|
|
}
|
|
if (availableTags != null && availableTags.length > 0) {
|
|
object4.available_tags = availableTags.map(function(a0) {
|
|
return {name: a0.name, emoji_id: a0.emojiId, emoji_name: a0.emojiName, moderated: a0.moderated};
|
|
});
|
|
}
|
|
const GUILD_STORE = ChannelTypes.GUILD_STORE;
|
|
if (type !== GUILD_STORE) {
|
|
defaultImport2 = importDefault(5046) /* metro dependency 5046: TrackedHTTPUtils */;
|
|
post = defaultImport2.post;
|
|
object3 = {};
|
|
object3.url = Endpoints.GUILD_CHANNELS(guildId);
|
|
object3.body = object4;
|
|
object3.oldFormErrors = true;
|
|
object3.trackedActionData = {event: NetworkActionNames.CHANNEL_CREATE, properties: properties};
|
|
} else {
|
|
if (skuId == null) {
|
|
throw new global.Error('Unexpected missing SKU');
|
|
}
|
|
object4.sku_id = skuId;
|
|
object4.branch_id = branchId;
|
|
defaultImport2 = importDefault(5046) /* metro dependency 5046: TrackedHTTPUtils */;
|
|
post = defaultImport2.post;
|
|
object3 = {};
|
|
object3.url = Endpoints.GUILD_CHANNELS(guildId);
|
|
object3.body = object4;
|
|
object3.oldFormErrors = true;
|
|
object3.trackedActionData = {event: NetworkActionNames.CHANNEL_CREATE, properties: properties};
|
|
}
|
|
object3.rejectWithError = false;
|
|
return Reflect.apply(post, defaultImport2, [object3]).then(_fun71010, _fun71011);
|
|
}
|
|
|
|
function createRoleSubscriptionTemplateChannel(a0, a1, a2, a3) { // fn#71012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9271:1463, offset: 0x01d1224c, size: 157 bytes, params: 5, frame: 17
|
|
const defaultImport = importDefault(5046) /* metro dependency 5046: TrackedHTTPUtils */;
|
|
const post = defaultImport.post;
|
|
const object2 = {};
|
|
object2.url = Endpoints.GUILD_CHANNELS(a0);
|
|
object2.body = {name: a1, type: a2, topic: a3};
|
|
object2.oldFormErrors = true;
|
|
const NetworkActionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).NetworkActionNames;
|
|
const CHANNEL_CREATE = NetworkActionNames.CHANNEL_CREATE;
|
|
object2.trackedActionData = {event: CHANNEL_CREATE, properties: properties};
|
|
object2.rejectWithError = false;
|
|
return Reflect.apply(post, defaultImport, [object2]);
|
|
}
|
|
|
|
function createChannelProperties(a0) { // fn#71009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9271:967, owner: createChannel.properties, offset: 0x01d120e0, size: 133 bytes, params: 2, frame: 17
|
|
let value = environment.__proto__;
|
|
value = undefined;
|
|
return (require(1392) /* metro dependency 1392: TypeUtils */).exact({is_private: env0_1.length > 0,
|
|
channel_id: a0 == null || a0.body == null ? value : a0.body.id,
|
|
channel_type: a0 == null || a0.body == null ? value : a0.body.type});
|
|
}
|
|
|
|
function _fun71010(a0) { // fn#71010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9271:1156, offset: 0x01d12165, size: 169 bytes, params: 2, frame: 23
|
|
var defaultImport;
|
|
let value = environment.__proto__;
|
|
if (UserGuildSettingsStore.isOptInEnabled(guildId)) {
|
|
defaultImport = importDefault(6613) /* metro dependency 6613: NotificationSettingsModalActionCreators */;
|
|
defaultImport.updateChannelOverrideSettings(guildId, a0.body.id,
|
|
{flags: ChannelNotificationSettingsFlags.OPT_IN_ENABLED},
|
|
(require(6610) /* metro dependency 6610: NotificationSettingsUtils */).NotificationLabels.OptedIn);
|
|
}
|
|
value = importDefault(6931) /* metro dependency 6931: GuildTemplateTooltipActionCreators */;
|
|
value.checkGuildTemplateDirty(guildId);
|
|
return a0;
|
|
}
|
|
|
|
function _fun71011(a0) { // fn#71011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9271:1332, offset: 0x01d1220e, size: 62 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CREATE_CHANNEL_MODAL_SUBMIT_FAILURE',
|
|
errors: a0.body});
|
|
throw a0;
|
|
}
|
|
|
|
function createRoleSubscriptionTemplateChannelProperties(a0) { // fn#71013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9271:1636, owner: createRoleSubscriptionTemplateChannel.properties, offset: 0x01d122e9, size: 117 bytes, params: 2, frame: 17
|
|
let value = environment.__proto__;
|
|
value = undefined;
|
|
return (require(1392) /* metro dependency 1392: TypeUtils */).exact({is_private: true,
|
|
channel_id: a0 == null || a0.body == null ? value : a0.body.id,
|
|
channel_type: a0 == null || a0.body == null ? value : a0.body.type});
|
|
}
|
|
|