decord/source/modules/video_calls/useChannelVideoLimit.tsx

54 lines
2.2 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 9048
// Function ID: 9049
2026-07-20 16:05:17 +00:00
// Name: useChannelVideoLimit
2026-08-05 07:35:12 +00:00
// Dependencies: [1862, 4327, 676, 589, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, getChannelVideoLimit
2026-08-05 07:35:12 +00:00
// Module 9048 (useChannelVideoLimit)
2026-07-29 08:29:29 +00:00
import createGuildRecordFromRust from "createGuildRecordFromRust";
import getVoiceStatesForGuild from "getVoiceStatesForGuild";
2026-07-23 10:11:24 +00:00
import { ChannelTypes } from "ME";
const require = arg1;
let result = require("ME").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-07-29 08:29:29 +00:00
const items = [getVoiceStatesForGuild, createGuildRecordFromRust];
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-07-23 10:11:24 +00:00
const result = outer1_3.countVoiceStatesForChannel(guildId.id);
const guild = outer1_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 };
} else if (guildId.type === outer1_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-07-29 08:29:29 +00:00
const result = getVoiceStatesForGuild.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;
};