decord/source/modules/video_calls/useChannelVideoLimit.tsx

54 lines
2.2 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 9692
// Function ID: 9693
2026-07-20 16:05:17 +00:00
// Name: useChannelVideoLimit
2026-08-24 06:08:38 +00:00
// Dependencies: [1910, 4550, 676, 589, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, getChannelVideoLimit
2026-08-24 06:08:38 +00:00
// Module 9692 (useChannelVideoLimit)
import closure_2 from "createGuildRecordFromRust" /* 1910 */;
import closure_3 from "getVoiceStatesForGuild" /* 4550 */;
import { ChannelTypes } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/video_calls/useChannelVideoLimit.tsx");
2026-07-20 16:05:17 +00:00
export default function useChannelVideoLimit(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
const items = [closure_3, closure_2];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
2026-07-29 08:29:29 +00:00
return _require(589).useStateFromStoresObject(items, () => {
2026-08-24 06:08:38 +00:00
const result = closure_1_3.countVoiceStatesForChannel(guildId.id);
const guild = closure_1_2.getGuild(guildId.getGuildId());
2026-07-20 16:05:17 +00:00
if (null == guild) {
2026-07-23 10:11:24 +00:00
let obj = { reachedLimit: false, limit: -1 };
2026-08-24 06:08:38 +00:00
} else if (guildId.type === closure_1_4.GUILD_STAGE_VOICE) {
2026-07-29 08:29:29 +00:00
obj = { reachedLimit: null, limit: null };
obj[0] = result > guild.maxStageVideoChannelUsers;
obj[1] = guild.maxStageVideoChannelUsers;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { reachedLimit: null, limit: null };
obj[0] = guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers;
obj[1] = guild.maxVideoChannelUsers;
const tmp5 = guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers;
2026-07-20 16:05:17 +00:00
}
return obj;
}, items1);
};
export const getChannelVideoLimit = function getChannelVideoLimit(channel) {
2026-08-24 06:08:38 +00:00
const result = closure_3.countVoiceStatesForChannel(channel.id);
2026-07-23 10:11:24 +00:00
guild = guild.getGuild(channel.getGuildId());
2026-07-20 16:05:17 +00:00
if (null == guild) {
2026-07-23 10:11:24 +00:00
let obj = { reachedLimit: false, limit: -1 };
2026-07-20 16:05:17 +00:00
} else if (channel.type === ChannelTypes.GUILD_STAGE_VOICE) {
2026-07-29 08:29:29 +00:00
obj = { reachedLimit: null, limit: null };
obj[0] = result > guild.maxStageVideoChannelUsers;
obj[1] = guild.maxStageVideoChannelUsers;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { reachedLimit: null, limit: null };
obj[0] = guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers;
obj[1] = guild.maxVideoChannelUsers;
const tmp4 = guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers;
2026-07-20 16:05:17 +00:00
}
return obj;
};