Files
discord-decomp/sources/stores/SessionsStore.tsx
T
2026-07-28 01:06:53 +03:00

171 lines
9.5 KiB
TypeScript

/* Metro module 4296; source: stores/SessionsStore.tsx; dependencies: [6, 7, 15, 17, 18, 1226, 22, 566, 694, 2] */
import ClassCallCheck from '../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Module00022 from '../by-id/module-00022.js'; /* Metro dependency 22 */
import Flux from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import AuthenticationStore from './AuthenticationStore.tsx'; /* Metro dependency 1226 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun36505(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#36505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:6, offset: 0x0108d57d, size: 319 bytes, params: 8, frame: 20
const closure = function(a0) {
env0_9 = {};
a0.sessions.forEach(_fun36510);
};
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
Object = global.Object;
const env0_8 = Object.freeze([]);
let env0_9 = {};
const Store = (Flux).Store;
let value = _fun36511(Store);
value.displayName = 'SessionsStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: closure,
SESSIONS_REPLACE: closure});
(FileImportTrackerModule).fileFinishedImporting('stores/SessionsStore.tsx');
exports.default = value;
function _isNativeReflectConstruct_36506() { // fn#36506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:158, offset: 0x0108d6bc, 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_36506_isNativeReflectConstruct = function() {
return !!result;
})();
}
function CONNECTION_OPEN_36509({sessions}) { // fn#36509, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:380, offset: 0x0108d71a, size: 39 bytes, params: 2, frame: 11
env0_9 = {};
sessions.forEach(_fun36510);
function _fun36510(a0) { // fn#36510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:430, offset: 0x0108d741, size: 24 bytes, params: 2, frame: 3
env1_9[a0.sessionId] = a0;
}
}
function _fun36511(a0) { // fn#36511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:460, offset: 0x0108d759, size: 233 bytes, params: 2, frame: 16
const SessionsStore2 = SessionsStore;
Inherits(SessionsStore2, a0);
return CreateClass(SessionsStore2, [{key: 'initialize', value: function() {
this.waitFor(AuthenticationStore);
}}, {key: 'getSessions', value: value_36514}, {key: 'getSession', value: value_36515}, {key: 'getRemoteActivities',
value: value_36516}, {key: 'getHiddenActivities', value: value_36518}, {key: 'getSessionById',
value: value_36520}, {key: 'getActiveSession', value: value_36521}, {key: 'getRemoteApplicationActivity',
value: value_36523}]);
function SessionsStore() { // fn#36512, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:472, offset: 0x00ec62ac, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_2(this, SessionsStore);
const value3 = env1_5(SessionsStore);
return env1_4(this, _isNativeReflectConstruct_36506() ? global.Reflect.construct(value3, arguments,
env1_5(this).constructor) : value3.apply(this, arguments));
}
function value_36514() { // fn#36514, offset: 0x00e07a77, size: 9 bytes, params: 1, frame: 1
return env1_9;
}
function value_36515() { // fn#36515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:855, offset: 0x0108d842, size: 42 bytes, params: 1, frame: 12
var r0;
let value = environment.__proto__;
value = AuthenticationStore.getSessionId();
const value2 = null;
if (value2 != value) {
value = this.getSessionById(value);
r0 = value;
} else {
r0 = value2;
}
return r0;
}
function value_36516() { // fn#36516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:967, offset: 0x0108d86c, size: 86 bytes, params: 1, frame: 14
const env0_0 = AuthenticationStore.getSessionId();
const defaultImport = Module00022;
const value2 = defaultImport.find(env1_9, _fun36517);
return value2 != null ? value2.activities : env1_8;
function _fun36517(a0) { // fn#36517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:1019, offset: 0x0108d8c2, size: 31 bytes, params: 2, frame: 3
return a0.active && a0.sessionId !== env0_0;
}
}
function value_36518() { // fn#36518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:1115, offset: 0x0108d8e1, size: 96 bytes, params: 1, frame: 14
const env0_0 = AuthenticationStore.getSessionId();
const defaultImport = Module00022;
const value2 = defaultImport.find(env1_9, _fun36519);
return value2 == null ? env1_8 : value2.hiddenActivities ?? env1_8;
function _fun36519(a0) { // fn#36519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:1167, offset: 0x0108d8c2, size: 31 bytes, params: 2, frame: 3
return a0.active && a0.sessionId !== env0_0;
}
}
function value_36520(a0) { // fn#36520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:1290, offset: 0x010197cf, size: 16 bytes, params: 2, frame: 2
return env1_9[a0];
}
function value_36521() { // fn#36521, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:1346, offset: 0x0108d941, size: 50 bytes, params: 1, frame: 13
const defaultImport = Module00022;
return defaultImport.find(env1_9, function(a0) {
return a0.active;
});
}
function value_36523(a0) { // fn#36523, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:1442, offset: 0x0108d97e, size: 152 bytes, params: 2, frame: 16
var environment;
const env0_0 = a0;
if (a0 == null) {
return null;
}
let value = environment.__proto__;
const env0_1 = AuthenticationStore.getSessionId();
const value2 = undefined;
const defaultImport = Module00022;
value = defaultImport.find(env1_9, _fun36524);
if (value == null) {
return null;
}
return value.activities.find(_fun36525) ?? (value.hiddenActivities == null ? value2 : value.hiddenActivities.find(_fun36526));
function _fun36524(a0) { // fn#36524, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:1524, offset: 0x0108da16, size: 31 bytes, params: 2, frame: 3
return a0.active && a0.sessionId !== env0_1;
}
function _fun36525({application_id}) { // fn#36525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:1603, offset: 0x0108da35, size: 22 bytes, params: 2, frame: 2
return application_id === env0_0;
}
function _fun36526({application_id}) { // fn#36526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4468:1690, offset: 0x0108da35, size: 22 bytes, params: 2, frame: 2
return application_id === env0_0;
}
}
}
}
global.__d(_fun36505, 4296, [6, 7, 15, 17, 18, 1226, 22, 566, 694,
2]) /* metro module 4296, dependencies: [6, 7, 15, 17, 18, 1226, 22, 566, 694, 2] */;