200 lines
11 KiB
TypeScript
200 lines
11 KiB
TypeScript
/* Metro module 8148; source: actions/ChannelSettingsActionCreators.tsx; dependencies: [5, 8149, 1379, 661, 694, 4008, 7153, 507, 6931, 2] */
|
|
function _fun65285(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#65285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8333:6, offset: 0x01bcadbe, size: 369 bytes, params: 8, frame: 29
|
|
var object2;
|
|
const env0_0 = require;
|
|
const closure = init_65286;
|
|
const closure2 = open_65287;
|
|
const closure3 = close_65288;
|
|
const closure4 = setSection_65289;
|
|
const closure5 = selectPermissionOverwrite;
|
|
const closure6 = updateChannel_65291;
|
|
const closure7 = function() {
|
|
return _saveChannel.apply(this, arguments);
|
|
};
|
|
const closure8 = function() {
|
|
return _deleteChannel.apply(this, arguments);
|
|
};
|
|
const closure9 = function(a0, a1) {
|
|
var HTTP = require(dependencyMap[7]).HTTP;
|
|
var object = {};
|
|
object.url = Endpoints.UPDATE_VOICE_CHANNEL_STATUS(a0);
|
|
object.body = {status: a1};
|
|
object.rejectWithError = false;
|
|
return HTTP.put(object);
|
|
};
|
|
const closure10 = function(a0) {
|
|
var HTTP = require(dependencyMap[7]).HTTP;
|
|
var object = {};
|
|
object.url = Endpoints.CHANNEL_LINKED_LOBBY(a0);
|
|
object.rejectWithError = true;
|
|
return HTTP.del(object);
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
const channelSettingsStore = importDefault(8149) /* metro dependency 8149: ChannelSettingsStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_6 = constantsModule.Endpoints;
|
|
constantsModule.Layers;
|
|
const env0_7 = constantsModule.ChannelSettingsSections;
|
|
object2 = {init: closure, open: closure2, close: closure3, setSection: closure4,
|
|
selectPermissionOverwrite: closure5, updateChannel: closure6, saveChannel: closure7, deleteChannel: closure8,
|
|
updateVoiceChannelStatus: closure9, removeLinkedLobby: closure10};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('actions/ChannelSettingsActionCreators.tsx');
|
|
exports.default = object2;
|
|
exports.init = closure;
|
|
exports.open = closure2;
|
|
exports.close = closure3;
|
|
exports.setSection = closure4;
|
|
exports.selectPermissionOverwrite = closure5;
|
|
exports.updateChannel = closure6;
|
|
exports.saveChannel = closure7;
|
|
exports.deleteChannel = closure8;
|
|
exports.updateVoiceChannelStatus = closure9;
|
|
exports.removeLinkedLobby = closure10;
|
|
}
|
|
|
|
function init_65286(a0, a1, a2) { // fn#65286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8333:189, offset: 0x01bcaf2f, size: 69 bytes, params: 4, frame: 13
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CHANNEL_SETTINGS_INIT', channelId: a0,
|
|
location: a1, subsection: a2});
|
|
}
|
|
|
|
function open_65287(a0, a1, a2) { // fn#65287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8333:295, offset: 0x01bcaf74, size: 143 bytes, params: 4, frame: 18
|
|
const rootNavigationRef = (require(4008) /* metro dependency 4008: RootNavigationRefNative */).getRootNavigationRef();
|
|
if (rootNavigationRef != null) {
|
|
if (rootNavigationRef.isReady()) {
|
|
init_65286(a0, a1, a2);
|
|
rootNavigationRef.navigate('sidebar', {channelId: a0,
|
|
initialRouteName: ChannelSettingsStore.getSection() ?? ChannelSettingsSections.OVERVIEW,
|
|
source: 'channel-settings-action-creators-open'});
|
|
}
|
|
}
|
|
}
|
|
|
|
function close_65288() { // fn#65288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8333:539, offset: 0x01bcb003, size: 47 bytes, params: 1, frame: 13
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CHANNEL_SETTINGS_CLOSE'});
|
|
}
|
|
|
|
function setSection_65289(a0) { // fn#65289, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8333:606, offset: 0x01bcb032, size: 55 bytes, params: 2, frame: 13
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CHANNEL_SETTINGS_SET_SECTION',
|
|
section: a0});
|
|
}
|
|
|
|
function selectPermissionOverwrite(a0) { // fn#65290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8333:695, offset: 0x01bcb069, size: 57 bytes, params: 2, frame: 13
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CHANNEL_SETTINGS_OVERWRITE_SELECT',
|
|
overwriteId: a0});
|
|
}
|
|
|
|
function updateChannel_65291({name, type, topic, bitrate, userLimit, nsfw, flags, rateLimitPerUser, defaultThreadRateLimitPerUser, defaultAutoArchiveDuration, template, defaultReactionEmoji, rtcRegion, videoQualityMode, autoArchiveDuration, locked, invitable, availableTags, defaultSortOrder, defaultForumLayout, defaultTagSetting, iconEmoji, themeColor}) { // fn#65291, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8333:808, offset: 0x01bcb0a2, size: 300 bytes, params: 2, frame: 36
|
|
const dispatcher = importDefault(694) /* metro dependency 694: Dispatcher */;
|
|
dispatcher.dispatch({type: 'CHANNEL_SETTINGS_UPDATE', name: name, channelType: type, topic: topic, bitrate: bitrate,
|
|
userLimit: userLimit, nsfw: nsfw, flags: flags, rateLimitPerUser: rateLimitPerUser,
|
|
defaultThreadRateLimitPerUser: defaultThreadRateLimitPerUser,
|
|
defaultAutoArchiveDuration: defaultAutoArchiveDuration, template: template,
|
|
defaultReactionEmoji: defaultReactionEmoji, rtcRegion: rtcRegion, videoQualityMode: videoQualityMode,
|
|
autoArchiveDuration: autoArchiveDuration, locked: locked, invitable: invitable, availableTags: availableTags,
|
|
defaultSortOrder: defaultSortOrder, defaultForumLayout: defaultForumLayout,
|
|
defaultTagSetting: defaultTagSetting, iconEmoji: iconEmoji, themeColor: themeColor});
|
|
}
|
|
|
|
function _saveChannel() { // fn#65293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8333:1653, offset: 0x01bcb1ce, size: 48 bytes, params: 1, frame: 14
|
|
return env0_3(_fun65295).apply(this, arguments);
|
|
}
|
|
|
|
function _deleteChannel() { // fn#65300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8333:3350, offset: 0x01bcb5a7, size: 48 bytes, params: 1, frame: 14
|
|
return env0_3(_fun65302).apply(this, arguments);
|
|
}
|
|
|
|
async function _fun65295(a0, {name, type, position, topic, bitrate, userLimit, nsfw, flags, permissionOverwrites, rateLimitPerUser, defaultThreadRateLimitPerUser, defaultAutoArchiveDuration, template, defaultReactionEmoji, rtcRegion, videoQualityMode, autoArchiveDuration, locked, invitable, availableTags, defaultSortOrder, defaultForumLayout, defaultTagSetting, iconEmoji, themeColor}) { // fn#65295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8333:1700, offset: 0x01bcb210, size: 638 bytes, params: 3, frame: 46
|
|
var object3;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
const env0_0 = a0;
|
|
value = undefined;
|
|
await value;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
let binding = env2_5;
|
|
const env0_1 = binding.getChannel(a0);
|
|
binding = env2_1;
|
|
const binding2 = env2_2;
|
|
binding(binding2[4]).dispatch({type: 'CHANNEL_SETTINGS_SUBMIT'});
|
|
const value7 = binding(binding2[6]);
|
|
await value7.unarchiveThreadIfNecessary(a0);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
const HTTP = env2_0(env2_2[7]).HTTP;
|
|
const patch = HTTP.patch;
|
|
object3 = {};
|
|
object3.url = env2_6.CHANNEL(a0);
|
|
const object4 = {name: name, type: type, position: position, topic: topic, bitrate: bitrate, user_limit: userLimit,
|
|
nsfw: nsfw, flags: flags, permission_overwrites: permissionOverwrites, rate_limit_per_user: rateLimitPerUser,
|
|
default_thread_rate_limit_per_user: defaultThreadRateLimitPerUser,
|
|
default_auto_archive_duration: defaultAutoArchiveDuration, template: template, rtc_region: rtcRegion,
|
|
video_quality_mode: videoQualityMode, auto_archive_duration: autoArchiveDuration, locked: locked,
|
|
invitable: invitable};
|
|
object4.default_reaction_emoji = defaultReactionEmoji != null ? {emoji_id: defaultReactionEmoji == null ? value : defaultReactionEmoji.emojiId,
|
|
emoji_name: defaultReactionEmoji == null ? value : defaultReactionEmoji.emojiName} : defaultReactionEmoji !== null ? value : null;
|
|
object4.available_tags = availableTags == null ? value : availableTags.map(function(a0) {
|
|
return {id: a0.id, name: a0.name, emoji_id: a0.emojiId, emoji_name: a0.emojiName, moderated: a0.moderated};
|
|
});
|
|
object4.default_sort_order = defaultSortOrder;
|
|
object4.default_forum_layout = defaultForumLayout;
|
|
object4.default_tag_setting = defaultTagSetting;
|
|
object4.icon_emoji = iconEmoji != null ? {id: iconEmoji.id,
|
|
name: iconEmoji.name} : iconEmoji !== null ? value : null;
|
|
object4.theme_color = themeColor;
|
|
object3.body = object4;
|
|
object3.oldFormErrors = true;
|
|
object3.rejectWithError = false;
|
|
return Reflect.apply(patch, HTTP, [object3]).then(_fun65297, _fun65298);
|
|
}
|
|
|
|
function* _fun65302(a0) { // fn#65302, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8333:3401, offset: 0x01bcb5e0, size: 208 bytes, params: 2, frame: 18
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
let binding = env2_5;
|
|
const channel = binding.getChannel(a0);
|
|
binding = env2_0;
|
|
const value4 = undefined;
|
|
const HTTP = binding(env2_2[7]).HTTP;
|
|
const del = HTTP.del;
|
|
const object2 = {'url': null, 'oldFormErrors': true, 'rejectWithError': true};
|
|
object2.url = env2_6.CHANNEL(a0);
|
|
yield Reflect.apply(del, HTTP, [object2]);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
const r6 = channel == null ? value4 : channel.getGuildId();
|
|
if (!(r6 == null || channel != null && channel.isThread())) {
|
|
env2_1(env2_2[8]).checkGuildTemplateDirty(r6);
|
|
}
|
|
env2_9();
|
|
return value4;
|
|
}
|
|
|
|
function _fun65297(a0) { // fn#65297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8333:2983, offset: 0x01bcb4c8, size: 161 bytes, params: 2, frame: 15
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
const binding = env3_1;
|
|
const value2 = undefined;
|
|
binding(env3_2[4]).dispatch({type: 'CHANNEL_SETTINGS_SUBMIT_SUCCESS', channelId: env0_0});
|
|
const r2 = env0_1 == null ? value2 : env0_1.getGuildId();
|
|
if (!(r2 == null || env0_1 != null && env0_1.isThread())) {
|
|
env3_1(env3_2[8]).checkGuildTemplateDirty(r2);
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
function _fun65298(a0) { // fn#65298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8333:3173, offset: 0x01bcb569, size: 62 bytes, params: 2, frame: 13
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
env3_1(env3_2[4]).dispatch({type: 'CHANNEL_SETTINGS_SUBMIT_FAILURE', errors: a0.body});
|
|
return a0;
|
|
}
|
|
|