decord/source/modules/voice_calls/native/CallStateHooks.tsx

122 lines
3.7 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 12729
// Function ID: 12730
2026-07-20 16:05:17 +00:00
// Name: id
2026-08-24 06:08:38 +00:00
// Dependencies: [4778, 1218, 4500, 4544, 676, 4549, 589, 9787, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 12729 (id)
import closure_3 from "getParticipants" /* 4778 */;
import closure_4 from "fetchFingerprint" /* 1218 */;
import closure_5 from "callConnect" /* 4500 */;
import closure_6 from "createRTCConnection" /* 4544 */;
import ME from "ME" /* 676 */;
import { ParticipantTypes } from "ParticipantTypes" /* 4549 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
const require = arg1;
({ EMPTY_STRING_SNOWFLAKE_ID: error, RTCConnectionStates: closure_8 } = ME);
2026-07-20 16:05:17 +00:00
let obj = {};
2026-08-24 06:08:38 +00:00
const merged = Object.assign({ initialized: false, callId: "r" });
2026-07-20 16:05:17 +00:00
obj = { DISCONNECTED: "disconneted", DISCONNECTING: "disconnecting", CONNECTING: "connecting", RINGING: "ringing", CONNECTED: "connected" };
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/voice_calls/native/CallStateHooks.tsx");
2026-07-20 16:05:17 +00:00
export default function _default() {
let tmp = arg0;
if (arg0 === undefined) {
tmp = closure_7;
}
2026-08-24 06:08:38 +00:00
const _require = tmp;
2026-07-29 08:29:29 +00:00
let flag = arg1;
if (arg1 === undefined) {
2026-07-20 16:05:17 +00:00
flag = false;
}
2026-07-29 08:29:29 +00:00
let flag2 = arg2;
if (arg2 === undefined) {
2026-07-20 16:05:17 +00:00
flag2 = false;
}
2026-07-23 10:11:24 +00:00
let id;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-23 10:11:24 +00:00
let stateFromStores;
id = id.getId();
2026-08-24 06:08:38 +00:00
obj = _require(589);
const items = [closure_5];
2026-07-20 16:05:17 +00:00
const items1 = [tmp, id];
const stateFromStoresArray = obj.useStateFromStoresArray(items, () => {
2026-08-24 06:08:38 +00:00
const call = closure_1_5.getCall(closure_0);
2026-07-20 16:05:17 +00:00
if (null != call) {
const ringing = call.ringing;
2026-07-29 08:29:29 +00:00
let found = ringing.filter((arg0) => arg0 !== closure_1);
2026-07-20 16:05:17 +00:00
} else {
found = [];
}
2026-08-24 06:08:38 +00:00
let initialized = closure_1_10.initialized;
2026-07-20 16:05:17 +00:00
if (!initialized) {
initialized = found.length > 0;
}
2026-08-24 06:08:38 +00:00
closure_1_10.initialized = initialized;
2026-07-20 16:05:17 +00:00
return found;
}, items1);
2026-07-23 10:11:24 +00:00
const participants = stateFromStores.getParticipants(tmp);
let found = participants.filter((type) => {
2026-08-24 06:08:38 +00:00
let tmp = type.type !== closure_1_9.ACTIVITY;
2026-07-20 16:05:17 +00:00
if (tmp) {
tmp = type.user.id !== id;
}
return tmp;
});
2026-08-24 06:08:38 +00:00
const tmp3 = id(9787)();
2026-07-20 16:05:17 +00:00
dependencyMap = tmp3;
const items2 = [getRTCConnectionId];
2026-08-24 06:08:38 +00:00
stateFromStores = _require(589).useStateFromStores(items2, getRTCConnectionId.getRTCConnectionId, []);
const obj2 = _require(589);
2026-07-20 16:05:17 +00:00
const items3 = [getRTCConnectionId];
const items4 = [stateFromStores, tmp3, tmp];
2026-08-24 06:08:38 +00:00
const stateFromStores1 = _require(589).useStateFromStores(items3, () => {
2026-07-20 16:05:17 +00:00
let channelId;
2026-08-24 06:08:38 +00:00
if (channelId != null) {
channelId = channelId.channelId;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (channelId === closure_0) {
2026-08-24 06:08:38 +00:00
closure_1_10.initialized = true;
return closure_1_8.RTC_CONNECTED;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
if (!tmp2) {
2026-08-24 06:08:38 +00:00
closure_1_10.initialized = false;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_1_10.callId = stateFromStores;
const state = closure_1_6.getState();
let initialized = closure_1_10.initialized;
2026-07-20 16:05:17 +00:00
if (!initialized) {
2026-08-24 06:08:38 +00:00
let tmp10 = state !== closure_1_8.DISCONNECTED;
2026-07-29 08:29:29 +00:00
if (tmp10) {
2026-08-24 06:08:38 +00:00
tmp10 = state !== closure_1_8.RTC_DISCONNECTED;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
initialized = tmp10;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_1_10.initialized = initialized;
2026-07-20 16:05:17 +00:00
return state;
}
}, items4);
2026-07-29 08:29:29 +00:00
obj.initialized = obj.initialized || flag2;
let state = obj.CONNECTING;
let initialized = tmp6.initialized;
2026-07-20 16:05:17 +00:00
if (flag) {
2026-07-29 08:29:29 +00:00
state = tmp7.DISCONNECTING;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
if (initialized) {
2026-07-20 16:05:17 +00:00
if (stateFromStores1 === constants.DISCONNECTED) {
2026-07-29 08:29:29 +00:00
state = tmp7.DISCONNECTED;
2026-07-20 16:05:17 +00:00
}
}
if (stateFromStoresArray.length > 0) {
if (found.length === stateFromStoresArray.length) {
2026-07-29 08:29:29 +00:00
state = tmp7.RINGING;
2026-07-20 16:05:17 +00:00
}
}
if (stateFromStores1 === constants.RTC_CONNECTED) {
2026-07-29 08:29:29 +00:00
state = tmp7.CONNECTED;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return { state, initialized };
2026-07-20 16:05:17 +00:00
};
export const CallStates = obj;