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

124 lines
3.7 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 12939
// Function ID: 12940
2026-07-20 16:05:17 +00:00
// Name: id
2026-08-05 07:35:12 +00:00
// Dependencies: [4268, 1218, 4946, 4326, 676, 4273, 589, 10634, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-05 07:35:12 +00:00
// Module 12939 (id)
2026-07-29 08:29:29 +00:00
import getParticipants from "getParticipants";
import fetchFingerprint from "fetchFingerprint";
import callConnect from "callConnect";
import createRTCConnection from "createRTCConnection";
2026-07-23 10:11:24 +00:00
import ME from "ME";
import { ParticipantTypes } from "ParticipantTypes";
2026-07-29 08:29:29 +00:00
let error;
let metroImportAll;
2026-07-23 10:11:24 +00:00
let require = arg1;
2026-07-29 08:29:29 +00:00
({ EMPTY_STRING_SNOWFLAKE_ID: error, RTCConnectionStates: metroImportAll } = ME);
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-29 08:29:29 +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-07-29 08:29:29 +00:00
const result = require("callConnect").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-07-23 10:11:24 +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-07-20 16:05:17 +00:00
let dependencyMap;
2026-07-23 10:11:24 +00:00
let stateFromStores;
id = id.getId();
2026-07-29 08:29:29 +00:00
const obj = require(589) /* initialize */;
const items = [callConnect];
2026-07-20 16:05:17 +00:00
const items1 = [tmp, id];
const stateFromStoresArray = obj.useStateFromStoresArray(items, () => {
2026-07-23 10:11:24 +00:00
const call = outer1_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-07-23 10:11:24 +00:00
let initialized = outer1_10.initialized;
2026-07-20 16:05:17 +00:00
if (!initialized) {
initialized = found.length > 0;
}
2026-07-23 10:11:24 +00:00
outer1_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) => {
let tmp = type.type !== outer1_9.ACTIVITY;
2026-07-20 16:05:17 +00:00
if (tmp) {
tmp = type.user.id !== id;
}
return tmp;
});
2026-08-05 07:35:12 +00:00
const tmp3 = id(10634)();
2026-07-20 16:05:17 +00:00
dependencyMap = tmp3;
const items2 = [getRTCConnectionId];
2026-07-29 08:29:29 +00:00
stateFromStores = require(589) /* initialize */.useStateFromStores(items2, getRTCConnectionId.getRTCConnectionId, []);
const obj2 = require(589) /* initialize */;
2026-07-20 16:05:17 +00:00
const items3 = [getRTCConnectionId];
const items4 = [stateFromStores, tmp3, tmp];
2026-07-29 08:29:29 +00:00
const stateFromStores1 = require(589) /* initialize */.useStateFromStores(items3, () => {
2026-07-20 16:05:17 +00:00
let channelId;
2026-07-29 08:29:29 +00:00
if (_undefined != null) {
2026-07-23 10:11:24 +00:00
channelId = _undefined.channelId;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (channelId === closure_0) {
outer1_10.initialized = true;
return outer1_8.RTC_CONNECTED;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
if (!tmp2) {
2026-07-23 10:11:24 +00:00
outer1_10.initialized = false;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
outer1_10.callId = stateFromStores;
const state = outer1_6.getState();
let initialized = outer1_10.initialized;
2026-07-20 16:05:17 +00:00
if (!initialized) {
2026-07-29 08:29:29 +00:00
let tmp10 = state !== outer1_8.DISCONNECTED;
if (tmp10) {
tmp10 = state !== outer1_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-07-23 10:11:24 +00:00
outer1_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;