decord/source/modules/rtc/hooks/useIsSecureFramesVerified.tsx

99 lines
4.5 KiB
TypeScript
Raw Normal View History

// Module ID: 9223
// Function ID: 9224
// Name: useIsSecureFramesVerified
// Dependencies: [502, 4630, 9224, 9225, 9226, 9262, 504, 9265, 4659, 2]
2026-07-20 16:05:17 +00:00
// Exports: useIsCallSecureFramesVerified, useIsStreamSecureFramesVerified, useIsUserSecureFramesVerified
// Module 9223 (useIsSecureFramesVerified)
import StreamKeyUtils from "StreamKeyUtils" /* 4659 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import RTCConnectionStore from "RTCConnectionStore" /* 4630 */;
import SecureFramesVerifiedStore from "SecureFramesVerifiedStore" /* 9224 */;
import TransientKeyStore from "TransientKeyStore" /* 9225 */;
import VerifiedKeyStore from "VerifiedKeyStore" /* 9226 */;
2026-07-22 07:54:56 +00:00
require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/rtc/hooks/useIsSecureFramesVerified.tsx");
2026-07-20 16:05:17 +00:00
export const useIsUserSecureFramesVerified = function useIsUserSecureFramesVerified(channelId) {
const userId = channelId.userId;
2026-08-31 15:47:37 +00:00
const userKey = channelId.userKey;
const isSecureFramesUIEnabled = userId(userKey[5]).useIsSecureFramesUIEnabled({ channelId: channelId.channelId });
2026-08-31 15:47:37 +00:00
const obj = userId(userKey[5]);
const items = [SecureFramesVerifiedStore, isSecureFramesUIEnabled, RTCConnectionStore, VerifiedKeyStore, TransientKeyStore];
2026-08-31 15:47:37 +00:00
const items1 = [isSecureFramesUIEnabled, userId, userKey];
return userId(userKey[6]).useStateFromStores(items, () => {
if (null != userId) {
if (isSecureFramesUIEnabled) {
if (RTCConnectionStore.isUserConnected(tmp)) {
if (AuthenticationStore.getId() !== tmp) {
2026-08-31 15:47:37 +00:00
if (undefined === userKey) {
return SecureFramesVerifiedStore.isUserVerified(tmp);
2026-08-31 15:47:37 +00:00
} else if (null === tmp4) {
return false;
} else {
const _Uint8Array = Uint8Array;
const uint8Array = new Uint8Array(tmp4);
let isKeyVerifiedResult = VerifiedKeyStore.isKeyVerified(tmp, uint8Array);
2026-08-31 15:47:37 +00:00
if (!isKeyVerifiedResult) {
isKeyVerifiedResult = TransientKeyStore.isKeyVerified(tmp, uint8Array);
2026-08-31 15:47:37 +00:00
}
return isKeyVerifiedResult;
}
}
}
}
2026-07-20 16:05:17 +00:00
}
2026-08-31 15:47:37 +00:00
return false;
2026-07-20 16:05:17 +00:00
}, items1);
};
export const useIsStreamSecureFramesVerified = function useIsStreamSecureFramesVerified(channelId) {
const streamKey = channelId.streamKey;
2026-07-29 08:29:29 +00:00
let isSecureFramesUIEnabled;
2026-08-31 15:47:37 +00:00
isSecureFramesUIEnabled = streamKey(isSecureFramesUIEnabled[5]).useIsSecureFramesUIEnabled({ channelId: channelId.channelId });
const obj = streamKey(isSecureFramesUIEnabled[5]);
const isStreamRTCConnectionEmpty = streamKey(isSecureFramesUIEnabled[7]).useIsStreamRTCConnectionEmpty(streamKey);
2026-08-31 15:47:37 +00:00
const obj2 = streamKey(isSecureFramesUIEnabled[7]);
const items = [SecureFramesVerifiedStore, isStreamRTCConnectionEmpty];
2026-07-20 16:05:17 +00:00
const items1 = [isStreamRTCConnectionEmpty, isSecureFramesUIEnabled, streamKey];
2026-08-31 15:47:37 +00:00
return streamKey(isSecureFramesUIEnabled[6]).useStateFromStores(items, () => {
2026-07-20 16:05:17 +00:00
if (isSecureFramesUIEnabled) {
if (!isStreamRTCConnectionEmpty) {
if (null == streamKey) {
return false;
} else {
const id = AuthenticationStore.getId();
let isStreamVerifiedResult = StreamKeyUtils.decodeStreamKey(tmp2).ownerId !== id;
2026-07-20 16:05:17 +00:00
if (isStreamVerifiedResult) {
isStreamVerifiedResult = SecureFramesVerifiedStore.isStreamVerified(tmp2);
2026-07-20 16:05:17 +00:00
}
return isStreamVerifiedResult;
}
}
}
return false;
}, items1);
};
export const useIsCallSecureFramesVerified = function useIsCallSecureFramesVerified(channelId) {
2026-07-29 08:29:29 +00:00
let isSecureFramesUIEnabled;
let isCallRTCConnectionEmpty;
2026-08-31 15:47:37 +00:00
isSecureFramesUIEnabled = isSecureFramesUIEnabled(isCallRTCConnectionEmpty[5]).useIsSecureFramesUIEnabled({ channelId: channelId.channelId });
const obj = isSecureFramesUIEnabled(isCallRTCConnectionEmpty[5]);
isCallRTCConnectionEmpty = isSecureFramesUIEnabled(isCallRTCConnectionEmpty[7]).useIsCallRTCConnectionEmpty();
const obj2 = isSecureFramesUIEnabled(isCallRTCConnectionEmpty[7]);
const items = [SecureFramesVerifiedStore];
2026-07-20 16:05:17 +00:00
const items1 = [isCallRTCConnectionEmpty, isSecureFramesUIEnabled];
2026-08-31 15:47:37 +00:00
return isSecureFramesUIEnabled(isCallRTCConnectionEmpty[6]).useStateFromStores(items, () => {
2026-07-29 08:29:29 +00:00
let tmp = !isSecureFramesUIEnabled;
if (isSecureFramesUIEnabled) {
tmp = isCallRTCConnectionEmpty;
}
let isCallVerifiedResult = !tmp;
if (!tmp) {
isCallVerifiedResult = SecureFramesVerifiedStore.isCallVerified();
2026-07-20 16:05:17 +00:00
}
return isCallVerifiedResult;
}, items1);
};