Files
discord-decomp/sources/modules/gateway/LocalPresenceStateManager.tsx
2026-07-28 01:06:53 +03:00

87 lines
4.8 KiB
TypeScript

/* Metro module 12528; source: modules/gateway/LocalPresenceStateManager.tsx; dependencies: [6, 7, 15, 17, 18, 6876, 12529, 12530, 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 SelfPresenceStore from '../../stores/SelfPresenceStore.tsx'; /* Metro dependency 6876 */
import StateManager from '../../lib/StateManager.tsx'; /* Metro dependency 12530 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun95452(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#95452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12718:6, offset: 0x02146b4b, size: 222 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = StateManager;
value = _fun95456(value);
(FileImportTrackerModule).fileFinishedImporting('modules/gateway/LocalPresenceStateManager.tsx');
exports.default = value;
function _isNativeReflectConstruct_95453() { // fn#95453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12718:158, offset: 0x02146c29, 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_95453_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun95456(a0) { // fn#95456, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12718:357, offset: 0x02146c8b, size: 203 bytes, params: 2, frame: 16
const LocalPresenceStateManager2 = LocalPresenceStateManager;
Inherits(LocalPresenceStateManager2, a0);
return CreateClass(LocalPresenceStateManager2, [{key: 'getInitialState', value: function() {
return SelfPresenceStore.getLocalPresence();
}}, {key: 'getNextState', value: function() {
return SelfPresenceStore.getLocalPresence();
}}, {key: 'shouldCommit', value: function() {
return this.socket.isSessionEstablished();
}}, {key: 'emitPresenceUpdate', value: function({status, since, activities, afk}) {
this.socket.presenceUpdate(status, since, activities, afk);
}}, {key: 'handleConnectionOpen', value: function() {
this.update({}, !this.switchingAccounts);
this.switchingAccounts = false;
}}, {key: 'handleAccountSwitch', value: function() {
this.switchingAccounts = true;
this.reset();
this.emitPresenceUpdate(this.getState());
}}]);
function LocalPresenceStateManager(a0) { // fn#95457, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12718:369, offset: 0x02146d56, size: 187 bytes, params: 2, frame: 21
const value = environment.__proto__;
env1_2(this, LocalPresenceStateManager);
const items2 = [false];
const value3 = env1_5(LocalPresenceStateManager);
const value6 = env1_4(this, _isNativeReflectConstruct_95453() ? global.Reflect.construct(value3, items2,
env1_5(this).constructor) : value3.apply(this, items2));
value6.socket = a0;
value6.switchingAccounts = false;
value6.didCommit = (importDefault(12529) /* metro dependency 12529: rateLimit */)(5, 20000,
value6.emitPresenceUpdate.bind(value6));
return value6;
}
}
}
global.__d(_fun95452, 12528, [6, 7, 15, 17, 18, 6876, 12529, 12530,
2]) /* metro module 12528, dependencies: [6, 7, 15, 17, 18, 6876, 12529, 12530, 2] */;