Files
2026-07-28 01:06:53 +03:00

90 lines
5.2 KiB
TypeScript

/* Metro module 9234; source: modules/video_calls/useChannelVideoLimit.tsx; dependencies: [1867, 4300, 661, 566, 2] */
import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import SortedVoiceStateStore from '../../stores/views/SortedVoiceStateStore.tsx'; /* Metro dependency 4300 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
function _fun72229(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#72229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9419:6, offset: 0x01d3ec88, size: 165 bytes, params: 8, frame: 19
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/video_calls/useChannelVideoLimit.tsx');
exports.default = function(a0) {
var env0_0 = a0;
return require(dependencyMap[3]).useStateFromStoresObject([SortedVoiceStateStore, GuildStore], _fun72231, [a0]);
};
exports.getChannelVideoLimit = getChannelVideoLimit;
function useChannelVideoLimit(a0) { // fn#72230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9419:227, offset: 0x01d3ed2d, size: 84 bytes, params: 2, frame: 17
const env0_0 = a0;
return (FluxModule).useStateFromStoresObject([SortedVoiceStateStore, GuildStore],
_fun72231, [a0]);
function _fun72231() { // fn#72231, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9419:307, offset: 0x01d3ed81, size: 176 bytes, params: 1, frame: 15
var r0;
var object;
var maxVideoChannelUsers;
var maxStageVideoChannelUsers;
let value = environment.__proto__;
const sortedVoiceStateStoreBinding = SortedVoiceStateStore;
const countVoiceStatesForChannel = sortedVoiceStateStoreBinding.countVoiceStatesForChannel;
const binding = env0_0;
const value3 = Reflect.apply(countVoiceStatesForChannel, sortedVoiceStateStoreBinding, [binding.id]);
const guildStoreBinding = GuildStore;
const getGuild = guildStoreBinding.getGuild;
const getGuildId = binding.getGuildId;
const value4 = Reflect.apply(getGuild, guildStoreBinding, [Reflect.apply(getGuildId, binding, [])]);
if (value4 == null) {
r0 = {'reachedLimit': false, 'limit': -1};
} else if (env0_0.type === ChannelTypes.GUILD_STAGE_VOICE) {
object = {};
maxStageVideoChannelUsers = value4.maxStageVideoChannelUsers;
object.reachedLimit = value3 > maxStageVideoChannelUsers;
maxStageVideoChannelUsers = value4.maxStageVideoChannelUsers;
object.limit = maxStageVideoChannelUsers;
r0 = object;
} else {
maxVideoChannelUsers = value4.maxVideoChannelUsers;
value = maxVideoChannelUsers > 0;
maxVideoChannelUsers = value4.maxVideoChannelUsers;
r0 = {reachedLimit: value && value3 > value4.maxVideoChannelUsers, limit: maxVideoChannelUsers};
}
return r0;
}
}
function getChannelVideoLimit(a0) { // fn#72232, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9419:658, offset: 0x01d3ee31, size: 168 bytes, params: 2, frame: 14
var r0;
var object;
var maxVideoChannelUsers;
var maxStageVideoChannelUsers;
var value;
const sortedVoiceStateStoreBinding = SortedVoiceStateStore;
const value2 = sortedVoiceStateStoreBinding.countVoiceStatesForChannel(a0.id);
const guildStoreBinding = GuildStore;
const getGuild = guildStoreBinding.getGuild;
const getGuildId = a0.getGuildId;
const value3 = Reflect.apply(getGuild, guildStoreBinding, [Reflect.apply(getGuildId, a0, [])]);
if (value3 == null) {
r0 = {'reachedLimit': false, 'limit': -1};
} else if (a0.type === ChannelTypes.GUILD_STAGE_VOICE) {
object = {};
maxStageVideoChannelUsers = value3.maxStageVideoChannelUsers;
object.reachedLimit = value2 > maxStageVideoChannelUsers;
maxStageVideoChannelUsers = value3.maxStageVideoChannelUsers;
object.limit = maxStageVideoChannelUsers;
r0 = object;
} else {
maxVideoChannelUsers = value3.maxVideoChannelUsers;
value = maxVideoChannelUsers > 0;
maxVideoChannelUsers = value3.maxVideoChannelUsers;
r0 = {reachedLimit: value && value2 > value3.maxVideoChannelUsers, limit: maxVideoChannelUsers};
}
return r0;
}
}
global.__d(_fun72229, 9234, [1867, 4300, 661, 566,
2]) /* metro module 9234, dependencies: [1867, 4300, 661, 566, 2] */;