decord/source/modules/gateway/GatewaySocketSingleton.tsx

79 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 13187
// Function ID: 13188
2026-07-29 08:29:29 +00:00
// Name: handleIdentify
2026-08-15 05:55:55 +00:00
// Dependencies: [1218, 3, 13188, 13227, 13230, 10501, 698, 675, 500, 4004, 1474, 709, 2]
2026-07-23 10:11:24 +00:00
2026-08-15 05:55:55 +00:00
// Module 13187 (handleIdentify)
2026-07-29 08:29:29 +00:00
import fetchFingerprint from "fetchFingerprint";
2026-07-23 10:11:24 +00:00
import set from "set";
2026-07-29 08:29:29 +00:00
import importDefaultResult from "awaitOnline";
import set from "noop";
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
let c4 = new require("getInitialState")("ConnectionStore");
let obj = new require("noop")();
const tmp3 = new require("getInitialState")(obj);
let closure_6 = tmp3;
const tmp2 = new require("getInitialState")("ConnectionStore");
obj.handleIdentify = () => {
let obj = token;
token = token.getToken();
obj = { hasToken: null != token };
tmp2.verbose("handleIdentify called", obj);
2026-07-20 16:05:17 +00:00
if (null == token) {
return null;
} else {
2026-08-15 05:55:55 +00:00
const state = importDefault(10501).getState();
2026-07-29 08:29:29 +00:00
const installationForTracking = obj.getInstallationForTracking();
obj = { token: null, properties: null, presence: null };
obj[0] = token;
const obj1 = {};
2026-08-15 05:55:55 +00:00
const obj5 = importDefault(10501);
2026-07-29 08:29:29 +00:00
const merged = Object.assign(importDefault(698).getSuperProperties());
obj1.client_app_state = state;
obj1.is_fast_connect = false;
const obj8 = importDefault(698);
obj1.gateway_connect_reasons = importAll(675).describeConnectionReasons();
2026-07-20 16:05:17 +00:00
if (null != installationForTracking) {
2026-07-29 08:29:29 +00:00
const obj2 = { installation_id: null };
obj2[0] = installationForTracking;
let obj3 = obj2;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj3 = {};
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const merged1 = Object.assign(obj3);
obj[1] = obj1;
obj[2] = obj1.getInitialState();
2026-07-20 16:05:17 +00:00
return obj;
}
};
2026-07-23 10:11:24 +00:00
if (set.isDesktop()) {
const powerMonitor = require("set").powerMonitor;
2026-07-20 16:05:17 +00:00
powerMonitor.on("resume", () => {
2026-07-29 08:29:29 +00:00
obj.expeditedHeartbeat(5000, "power monitor resumed");
2026-07-20 16:05:17 +00:00
});
}
2026-07-29 08:29:29 +00:00
const tmp4 = new require("guildId")(obj);
2026-07-23 10:11:24 +00:00
require("awaitOnline").addOfflineCallback(() => {
2026-07-29 08:29:29 +00:00
obj.networkStateChange(15000, "network detected offline.", false);
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
require("awaitOnline").addOnlineCallback(() => {
2026-07-29 08:29:29 +00:00
obj.networkStateChange(5000, "network detected online.");
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
obj.on("disconnect", (arg0) => {
2026-07-20 16:05:17 +00:00
let code;
let reason;
({ code, reason } = arg0);
2026-07-29 08:29:29 +00:00
importDefault(709).dispatch({ type: "CONNECTION_CLOSED", code, reason });
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
obj.on("close", (arg0) => {
2026-07-20 16:05:17 +00:00
let code;
let reason;
({ code, reason } = arg0);
2026-07-29 08:29:29 +00:00
importDefault(709).dispatch({ type: "CONNECTION_INTERRUPTED", code, reason });
2026-07-20 16:05:17 +00:00
});
2026-07-23 10:11:24 +00:00
const result = set.fileFinishedImporting("modules/gateway/GatewaySocketSingleton.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const socket = obj;
export const localPresenceState = tmp3;
export const localVoiceState = tmp4;