decord/source/modules/video_calls/useChannelVideoLimit.tsx

51 lines
2.1 KiB
TypeScript
Raw Normal View History

// Module ID: 9217
// Function ID: 9218
2026-07-20 16:05:17 +00:00
// Name: useChannelVideoLimit
// Dependencies: [1979, 4660, 1074, 504, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, getChannelVideoLimit
// Module 9217 (useChannelVideoLimit)
import GuildStore from "GuildStore" /* 1979 */;
import SortedVoiceStateStore from "SortedVoiceStateStore" /* 4660 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
const require = fn;
const ChannelTypes = fn(1074).ChannelTypes;
const size = fn(2);
let result = size.fileFinishedImporting("modules/video_calls/useChannelVideoLimit.tsx");
2026-07-20 16:05:17 +00:00
export default function useChannelVideoLimit(arg0) {
_require = arg0;
const items = [SortedVoiceStateStore, GuildStore];
2026-07-20 16:05:17 +00:00
const items1 = [arg0];
return require("initialize").useStateFromStoresObject(items, () => {
const result = SortedVoiceStateStore.countVoiceStatesForChannel(guildId.id);
const guild = GuildStore.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 };
} else if (guildId.type === ChannelTypes.GUILD_STAGE_VOICE) {
const obj2 = { reachedLimit: result > guild.maxStageVideoChannelUsers, limit: guild.maxStageVideoChannelUsers };
obj = obj2;
2026-07-20 16:05:17 +00:00
} else {
obj = { reachedLimit: guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers, limit: guild.maxVideoChannelUsers };
2026-07-29 08:29:29 +00:00
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) {
const result = SortedVoiceStateStore.countVoiceStatesForChannel(channel.id);
const guild = GuildStore.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) {
const obj2 = { reachedLimit: result > guild.maxStageVideoChannelUsers, limit: guild.maxStageVideoChannelUsers };
obj = obj2;
2026-07-20 16:05:17 +00:00
} else {
obj = { reachedLimit: guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers, limit: guild.maxVideoChannelUsers };
2026-07-29 08:29:29 +00:00
const tmp4 = guild.maxVideoChannelUsers > 0 && result > guild.maxVideoChannelUsers;
2026-07-20 16:05:17 +00:00
}
return obj;
};