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

225 lines
8.6 KiB
TypeScript

/* Metro module 5093; source: modules/channel/ChannelStatusStore.tsx; dependencies: [6, 7, 15, 17, 18, 4257, 677, 566, 694, 2] */
function _fun44411(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#44411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5271:6, offset: 0x011703f5, size: 387 bytes, params: 8, frame: 22
const env0_0 = require;
const _arrayLikeToArray_44417 = function(a0, a1) {
var r0;
var r1;
var r2;
var value3;
var length;
var value5;
var value = undefined;
var value2 = value == null;
reducibleJoin2: while (true) {
if (value2) {
r0 = value2;
break reducibleJoin2;
}
value3 = value > a0.length;
r0 = value3;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (r0) {
length = a0.length;
r1 = length;
break reducibleJoin4;
}
r1 = value;
break reducibleJoin4;
}
value = (0, global.Array)(r1);
var value4 = 0;
if (value4 < r1) {
r2 = value4;
reducibleLoop5: while (true) {
value[r2] = a0[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value5 < r1) {
r2 = value5;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
return value;
};
const closure = CONNECTION_RESUMED_44418;
const closure2 = GUILD_CREATE_44419;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
const gatewayConnectionStore = importDefault(4257) /* metro dependency 4257: GatewayConnectionStore */;
const Set = global.Set;
let set = new Set();
const env0_9 = {};
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
_fun44420(Store).displayName = 'ChannelStatusStore';
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {GUILD_CREATE: closure2,
GUILD_DELETE: closure2, CONNECTION_RESUMED: closure, CONNECTION_OPEN: closure,
VOICE_CHANNEL_STATUS_UPDATE: VOICE_CHANNEL_STATUS_UPDATE_44425, CHANNEL_INFO: CHANNEL_INFO_44426,
FETCH_CHANNEL_INFO: FETCH_CHANNEL_INFO});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/channel/ChannelStatusStore.tsx');
exports.default = set;
}
function _isNativeReflectConstruct_44412() { // fn#44412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5271:160, offset: 0x01170578, size: 94 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_44412_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_44415(a0, a1) { // fn#44415, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5271:353, offset: 0x011705d6, size: 370 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun44416;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_44417(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_44417(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_44417(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun44416;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
function CONNECTION_OPEN_44418() { // fn#44418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5271:1282, offset: 0x01170748, size: 21 bytes, params: 1, frame: 9
env0_8.clear();
}
function GUILD_CREATE_44419({guild}) { // fn#44419, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5271:1325, offset: 0x0117075d, size: 34 bytes, params: 2, frame: 11
env0_8.delete(guild.id);
}
function _fun44420(a0) { // fn#44420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5271:1381, offset: 0x0117077f, size: 118 bytes, params: 2, frame: 16
const closure = ChannelStatusStore;
env0_6(closure, a0);
return env0_3(closure, [{key: 'initialize', value: function() {
this.waitFor(GatewayConnectionStore);
}}, {key: 'getChannelStatus', value: value_44423}, {key: 'hasRequestedStatuses', value: value_44424}]);
}
function VOICE_CHANNEL_STATUS_UPDATE_44425(a0) { // fn#44425, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5271:2204, offset: 0x01170870, size: 71 bytes, params: 2, frame: 5
if (env0_9[a0.guildId] == null) {
env0_9[a0.guildId] = {};
}
env0_9[a0.guildId][a0.id] = a0.status;
}
function CHANNEL_INFO_44426({guildId, channels}) { // fn#44426, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5271:2327, offset: 0x011708b7, size: 94 bytes, params: 2, frame: 16
var r2;
var value4;
var id;
var status;
var value5;
env0_9[guildId] = {};
const value2 = _createForOfIteratorHelperLoose_44415(channels);
const value3 = value2();
let done = value3.done;
if (!done) {
for (r2 = value3; true; r2 = value5) {
value4 = r2.value;
id = value4.id;
status = value4.status;
env0_9[guildId][id] = status;
value5 = value2();
done = value5.done;
if (done) {
break;
}
}
}
}
function value_44423(a0) { // fn#44423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5271:1760, offset: 0x011707f5, size: 101 bytes, params: 2, frame: 15
var property;
if (a0 != null) {
if (a0.guild_id == null) {
return undefined;
}
var type = a0.type;
var value2 = undefined;
var ChannelTypes = (require(677) /* metro dependency 677: ChannelTypes */).ChannelTypes;
var GUILD_VOICE = ChannelTypes.GUILD_VOICE;
if (type === GUILD_VOICE) {
property = env1_9[a0.guild_id];
return property == null ? value2 : property[a0.id];
}
}
}