decord/source/modules/gateway/GatewaySocketSingleton.tsx
2026-09-03 10:05:34 +00:00

82 lines
2.9 KiB
TypeScript

// Module ID: 13522
// Function ID: 13523
// Name: handleIdentify
// Dependencies: [1215, 3, 13523, 13564, 13567, 11161, 695, 672, 1234, 4103, 1472, 706, 2]
// Module 13522 (handleIdentify)
import timestampDefault from "timestamp" /* 3 */;
import setRequestedByAll from "setRequestedBy" /* 672 */;
import expandEventPropertiesDefault from "expandEventProperties" /* 695 */;
import dispatcherDefault from "dispatcher" /* 706 */;
import setDefault from "set" /* 4103 */;
import _modDef11161 from "module_11161" /* 11161 */;
import noopDefault from "noop" /* 13523 */;
import getInitialStateDefault from "getInitialState" /* 13564 */;
import guildIdDefault from "guildId" /* 13567 */;
import closure_3 from "fetchFingerprint" /* 1215 */;
import set from "set" /* 1234 */;
import importDefaultResult from "awaitOnline" /* 1472 */;
let closure_4 = new timestampDefault("ConnectionStore");
let obj = new noopDefault();
const tmp3 = new getInitialStateDefault(obj);
let closure_6 = tmp3;
const tmp2 = new timestampDefault("ConnectionStore");
obj.handleIdentify = () => {
obj = token;
token = token.getToken();
obj = { hasToken: null != token };
closure_4.verbose("handleIdentify called", obj);
if (null == token) {
return null;
} else {
const state = _modDef11161.getState();
const installationForTracking = obj.getInstallationForTracking();
obj = { token: null, properties: null, presence: null };
obj[0] = token;
obj1 = {};
const obj5 = _modDef11161;
const merged = Object.assign(expandEventPropertiesDefault.getSuperProperties());
obj1.client_app_state = state;
obj1.is_fast_connect = false;
const obj8 = expandEventPropertiesDefault;
obj1.gateway_connect_reasons = setRequestedByAll.describeConnectionReasons();
if (null != installationForTracking) {
const obj2 = { installation_id: null };
obj2[0] = installationForTracking;
let obj3 = obj2;
} else {
obj3 = {};
}
const merged1 = Object.assign(obj3);
obj[1] = obj1;
obj[2] = initialState.getInitialState();
return obj;
}
};
if (set.isDesktop()) {
const powerMonitor = setDefault.powerMonitor;
powerMonitor.on("resume", () => {
obj.expeditedHeartbeat(5000, "power monitor resumed");
});
}
const tmp4 = new guildIdDefault(obj);
importDefaultResult.addOfflineCallback(() => {
obj.networkStateChange(15000, "network detected offline.", false);
});
importDefaultResult.addOnlineCallback(() => {
obj.networkStateChange(5000, "network detected online.");
});
obj.on("disconnect", (arg0) => {
({ code, reason } = arg0);
dispatcherDefault.dispatch({ type: "CONNECTION_CLOSED", code, reason });
});
obj.on("close", (arg0) => {
({ code, reason } = arg0);
dispatcherDefault.dispatch({ type: "CONNECTION_INTERRUPTED", code, reason });
});
const result = set.fileFinishedImporting("modules/gateway/GatewaySocketSingleton.tsx");
export const socket = obj;
export const localPresenceState = tmp3;
export const localVoiceState = tmp4;