decord/source/modules/request_to_stream/useCanFulfillStreamRequest.tsx

106 lines
3.5 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 11325
// Function ID: 11326
2026-07-20 16:05:17 +00:00
// Name: canFulfillStreamRequest
2026-08-25 06:04:03 +00:00
// Dependencies: [4403, 4402, 1218, 1391, 1910, 4025, 4469, 4454, 676, 10908, 500, 589, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 11325 (canFulfillStreamRequest)
import closure_2 from "initialize" /* 4403 */;
import closure_3 from "reset" /* 4402 */;
2026-08-24 06:08:38 +00:00
import closure_4 from "fetchFingerprint" /* 1218 */;
import closure_5 from "ensureGuildLoaded" /* 1391 */;
import closure_6 from "createGuildRecordFromRust" /* 1910 */;
2026-08-25 06:04:03 +00:00
import closure_7 from "getUncachedChannelPermissions" /* 4025 */;
import closure_8 from "sortActivity" /* 4469 */;
import closure_9 from "createRTCConnection" /* 4454 */;
2026-08-24 06:08:38 +00:00
import ME from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function canFulfillStreamRequest(channel_id, arg1) {
let flag = arg1;
if (arg1 === undefined) {
flag = false;
}
2026-08-24 06:08:38 +00:00
obj = arg2;
2026-07-29 08:29:29 +00:00
if (arg2 === undefined) {
2026-08-24 06:08:38 +00:00
obj = closure_3;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj2 = arg3;
if (arg3 === undefined) {
2026-08-24 06:08:38 +00:00
obj2 = closure_5;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj3 = arg4;
if (arg4 === undefined) {
2026-08-24 06:08:38 +00:00
obj3 = closure_8;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj4 = arg6;
if (arg6 === undefined) {
2026-08-24 06:08:38 +00:00
obj4 = closure_9;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let id;
2026-07-20 16:05:17 +00:00
let DESKTOP;
const channel = obj2.getChannel(channel_id.channel_id);
if (null == channel) {
const items = [false, obj.NOT_IN_VOICE_CHANNEL];
return items;
} else {
const channelId = obj4.getChannelId();
2026-07-29 08:29:29 +00:00
const tmp15 = null != obj.getCurrentUserActiveStream();
const tmp16 = flag;
const tmp17 = id;
2026-07-20 16:05:17 +00:00
const application = channel_id.application;
2026-07-23 10:11:24 +00:00
id = undefined;
const videoPermission = flag(id[9]).getVideoPermission(channel);
2026-07-29 08:29:29 +00:00
if (application != null) {
2026-07-20 16:05:17 +00:00
id = application.id;
}
DESKTOP = constants.DESKTOP;
2026-07-23 10:11:24 +00:00
const obj6 = flag(id[9]);
2026-07-29 08:29:29 +00:00
DESKTOP = tmp16(tmp17[10]).isAndroid() ? tmp3.ANDROID : tmp3.IOS;
2026-07-20 16:05:17 +00:00
if (null == id) {
const items1 = [false, obj.NOT_RUNNING_GAME];
return items1;
} else {
const activities = obj3.getActivities(id.getId(), channel.guild_id);
2026-07-29 08:29:29 +00:00
if (tmp15) {
2026-07-20 16:05:17 +00:00
const items2 = [false, obj.ALREADY_STREAMING];
let items4 = items2;
} else if (channelId === channel_id.channel_id) {
const items3 = [, ];
if (!videoPermission) {
items3[0] = false;
items3[1] = obj.NO_PERMISSION;
}
2026-07-29 08:29:29 +00:00
if (tmp21) {
2026-07-20 16:05:17 +00:00
items3[0] = true;
items3[1] = null;
2026-07-29 08:29:29 +00:00
let tmp8 = items3;
2026-07-20 16:05:17 +00:00
} else {
items3[0] = false;
items3[1] = obj.NOT_RUNNING_GAME;
2026-07-29 08:29:29 +00:00
tmp8 = items3;
2026-07-20 16:05:17 +00:00
}
} else {
items4 = [false, obj.NOT_IN_VOICE_CHANNEL];
}
return items4;
}
2026-07-29 08:29:29 +00:00
const tmp16Result = tmp16(tmp17[10]);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
({ ActivityGamePlatforms: c10, ActivityTypes: unpackModuleId } = ME);
2026-07-23 10:11:24 +00:00
let obj = { NOT_IN_VOICE_CHANNEL: "NOT_IN_VOICE_CHANNEL", NOT_RUNNING_GAME: "NOT_RUNNING_GAME", ALREADY_STREAMING: "ALREADY_STREAMING", NO_PERMISSION: "NO_PERMISSION", PENDING_REQUEST: "PENDING_REQUEST", EXPIRED: "EXPIRED" };
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/request_to_stream/useCanFulfillStreamRequest.tsx");
2026-07-20 16:05:17 +00:00
export default function useCanFulfillStreamRequest(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-07-29 08:29:29 +00:00
let flag = arg1;
2026-07-20 16:05:17 +00:00
if (arg1 === undefined) {
flag = false;
}
2026-08-24 06:08:38 +00:00
const items = [closure_3, closure_5, closure_8, closure_2, closure_9, closure_6, closure_7];
return _require(flag[11]).useStateFromStores(items, () => closure_1_13(closure_0, flag, closure_1_3, closure_1_5, closure_1_8, closure_1_2, closure_1_9, closure_1_6, closure_1_7));
2026-07-20 16:05:17 +00:00
};
export const StreamRequestUnfulfillableReason = obj;
export { canFulfillStreamRequest };