202 lines
12 KiB
TypeScript
202 lines
12 KiB
TypeScript
/* Metro module 8148; source: actions/ChannelSettingsActionCreators.tsx; dependencies: [5, 8149, 1379, 661, 694, 4008, 7153, 507, 6931, 2] */
|
|
import Module00005 from '../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Dispatcher from '../Dispatcher.tsx'; /* Metro dependency 694 */
|
|
import ChannelStore from '../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
|
|
import ChannelSettingsStore from '../stores/ChannelSettingsStore.tsx'; /* Metro dependency 8149 */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as RootNavigationRefNativeModule from '../modules/main_tabs_v2/RootNavigationRef.native.tsx'; /* Metro dependency 4008 */
|
|
|
|
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
|
|
const env0_0 = require;
|
|
const init_652862 = init_65286;
|
|
const open_652872 = open_65287;
|
|
const close_652882 = close_65288;
|
|
const setSection_652892 = setSection_65289;
|
|
const selectPermissionOverwrite2 = selectPermissionOverwrite;
|
|
const updateChannel_652912 = 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});
|
|
ConstantsModule.Layers;
|
|
object = {init: init_652862, open: open_652872, close: close_652882, setSection: setSection_652892,
|
|
selectPermissionOverwrite: selectPermissionOverwrite2, updateChannel: updateChannel_652912,
|
|
saveChannel: closure7, deleteChannel: closure8, updateVoiceChannelStatus: closure9,
|
|
removeLinkedLobby: closure10};
|
|
(FileImportTrackerModule).fileFinishedImporting('actions/ChannelSettingsActionCreators.tsx');
|
|
exports.default = object;
|
|
exports.init = init_652862;
|
|
exports.open = open_652872;
|
|
exports.close = close_652882;
|
|
exports.setSection = setSection_652892;
|
|
exports.selectPermissionOverwrite = selectPermissionOverwrite2;
|
|
exports.updateChannel = updateChannel_652912;
|
|
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
|
|
(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 = (RootNavigationRefNativeModule).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
|
|
(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
|
|
(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
|
|
(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
|
|
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 Module00005(_fun65295).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
|
|
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;
|
|
object = {};
|
|
object.url = env2_6.CHANNEL(a0);
|
|
const object2 = {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};
|
|
object2.default_reaction_emoji = defaultReactionEmoji != null ? {emoji_id: defaultReactionEmoji == null ? value : defaultReactionEmoji.emojiId,
|
|
emoji_name: defaultReactionEmoji == null ? value : defaultReactionEmoji.emojiName} : defaultReactionEmoji !== null ? value : null;
|
|
object2.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};
|
|
});
|
|
object2.default_sort_order = defaultSortOrder;
|
|
object2.default_forum_layout = defaultForumLayout;
|
|
object2.default_tag_setting = defaultTagSetting;
|
|
object2.icon_emoji = iconEmoji != null ? {id: iconEmoji.id,
|
|
name: iconEmoji.name} : iconEmoji !== null ? value : null;
|
|
object2.theme_color = themeColor;
|
|
object.body = object2;
|
|
object.oldFormErrors = true;
|
|
object.rejectWithError = false;
|
|
return Reflect.apply(patch, HTTP, [object]).then(_fun65297, _fun65298);
|
|
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;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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 Module00005(_fun65302).apply(this, arguments);
|
|
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 object = {'url': null, 'oldFormErrors': true, 'rejectWithError': true};
|
|
object.url = env2_6.CHANNEL(a0);
|
|
yield Reflect.apply(del, HTTP, [object]);
|
|
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;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun65285, 8148, [5, 8149, 1379, 661, 694, 4008, 7153, 507, 6931,
|
|
2]) /* metro module 8148, dependencies: [5, 8149, 1379, 661, 694, 4008, 7153, 507, 6931, 2] */;
|