Files
discord-decomp/sources/modules/channel/SelectedChannelManager.tsx
T
2026-07-27 16:20:00 +03:00

133 lines
6.6 KiB
TypeScript

/* Metro module 15823; source: modules/channel/SelectedChannelManager.tsx; dependencies: [6, 7, 15, 17, 18, 4259, 1934, 3969, 661, 6947, 4796, 1230, 694, 4860, 2] */
function _fun121611(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121611, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16031:6, offset: 0x0254bfdb, size: 349 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const env0_5 = importDefault(15) /* metro dependency 15 */;
const env0_6 = importDefault(17) /* metro dependency 17 */;
const env0_7 = importDefault(18) /* metro dependency 18 */;
const mediaEngineStore = importDefault(4259) /* metro dependency 4259: MediaEngineStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
const env0_10 = (require(1934) /* metro dependency 1934: SelectedChannelStore */).findFirstVoiceChannelId;
const selectedGuildStore = importDefault(3969) /* metro dependency 3969: SelectedGuildStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_12 = value.ChannelTypes;
const env0_13 = value.Routes;
const env0_14 = value.ME;
const env0_15 = value.NULL_STRING_GUILD_ID;
value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
value = _fun121615(value);
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/channel/SelectedChannelManager.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_121612() { // fn#121612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16031:282, offset: 0x0254c138, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_121612_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun121615(a0) { // fn#121615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16031:485, offset: 0x0254c19a, size: 122 bytes, params: 2, frame: 16
const closure = SelectedChannelManager;
env0_7(closure, a0);
return env0_4(closure, [{key: 'handleGuildCreate', value: value_121617}, {key: 'handleChannelCreate',
value: value_121618}, {key: 'handleLogout', value: value_121619}]);
}
function SelectedChannelManager(a0) { // fn#121616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16031:497, offset: 0x0254c214, size: 167 bytes, params: 2, frame: 19
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_3;
binding(this, SelectedChannelManager);
const items = [];
arraySpread(items, value, 0, items);
value = env1_6(SelectedChannelManager);
binding = env1_5;
if (_isNativeReflectConstruct_121612()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items, env1_6(this).constructor);
r0 = value;
} else {
value = value.apply(this, items);
r0 = value;
}
value = binding(this, r0);
value.actions = {GUILD_CREATE: value.handleGuildCreate, CHANNEL_CREATE: value.handleChannelCreate,
LOGOUT: value.handleLogout};
return value;
}
function value_121617({guild}) { // fn#121617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16031:947, offset: 0x0254c2bb, size: 174 bytes, params: 2, frame: 14
var moduleValue;
var defaultImport;
const channelId = SelectedChannelStore.getChannelId(ME);
const voiceChannelId = SelectedChannelStore.getVoiceChannelId();
if (guild.id === channelId) {
moduleValue = require(6947) /* metro dependency 6947: transitionToGuildNative */;
moduleValue.transitionToGuild(guild.id);
}
if (guild.id === voiceChannelId && guild.unavailable !== false && voiceChannelId == null) {
defaultImport = importDefault(4796) /* metro dependency 4796: SelectedChannelActionCreators */;
defaultImport.selectVoiceChannel(findFirstVoiceChannelId(guild.id));
}
}
function value_121618({channel}) { // fn#121618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16031:1168, offset: 0x0254c369, size: 238 bytes, params: 2, frame: 19
var r3;
var originChannelId;
var channelId;
var moduleValue;
var defaultImport;
const type = channel.type;
const GROUP_DM = ChannelTypes.GROUP_DM;
if (type === GROUP_DM) {
originChannelId = channel.originChannelId;
channelId = SelectedChannelStore.getChannelId(NULL_STRING_GUILD_ID);
r3 = SelectedGuildStore.getGuildId() == null && originChannelId != null;
r3 = r3 && originChannelId === channelId;
if (r3) {
moduleValue = require(1230) /* metro dependency 1230: router_utils */;
moduleValue.transitionTo(Routes.CHANNEL(ME, channel.id));
}
if (originChannelId != null && originChannelId === SelectedChannelStore.getVoiceChannelId()) {
defaultImport = importDefault(4796) /* metro dependency 4796: SelectedChannelActionCreators */;
defaultImport.selectVoiceChannel(channel.id, MediaEngineStore.isVideoEnabled());
}
}
}
function value_121619() { // fn#121619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16031:1455, offset: 0x0254c457, size: 51 bytes, params: 1, frame: 12
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({'type': 'VOICE_CHANNEL_SELECT',
'channelId': null, 'guildId': null, 'video': false, 'currentVoiceChannelId': null, 'joinVoiceId': null});
}