decord/source/modules/guild_sidebar/native/ChannelInfo.tsx

181 lines
6.6 KiB
TypeScript
Raw Normal View History

2026-07-31 08:44:05 +00:00
// Module ID: 15212
// Function ID: 15213
2026-07-20 16:05:17 +00:00
// Name: LimitAndDurationInfo
2026-07-31 08:44:05 +00:00
// Dependencies: [19, 5790, 1862, 3821, 4205, 4209, 676, 21, 4193, 589, 11247, 5794, 9142, 15213, 15214, 4377, 1297, 15216, 15217, 15126, 5011, 11461, 15127, 15218, 12013, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-31 08:44:05 +00:00
// Module 15212 (LimitAndDurationInfo)
2026-07-29 08:29:29 +00:00
import "SubscriptionGatedChannelIcon";
import guildHasCommunity from "guildHasCommunity";
import createGuildRecordFromRust from "createGuildRecordFromRust";
import getUncachedChannelPermissions from "getUncachedChannelPermissions";
import generateOldThreadCutoff from "generateOldThreadCutoff";
import updateVoiceState from "updateVoiceState";
2026-07-23 10:11:24 +00:00
import ME from "ME";
2026-07-29 08:29:29 +00:00
import { jsx } from "useShowConnectedUserLimit";
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let Fonts;
let c9;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function LimitAndDurationInfo(channel) {
let hasMedia;
let hasVideo;
let selected;
let voiceStatesCount;
channel = channel.channel;
({ voiceStatesCount, selected } = channel);
2026-07-29 08:29:29 +00:00
let obj = channel(589);
const items = [updateVoiceState, getUncachedChannelPermissions];
2026-07-20 16:05:17 +00:00
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => {
let isGuildStageVoiceResult = channel.isGuildStageVoice();
if (isGuildStageVoiceResult) {
2026-07-23 10:11:24 +00:00
let obj = channel(outer1_2[20]);
2026-07-29 08:29:29 +00:00
isGuildStageVoiceResult = obj.getStageHasMedia(tmp.id);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { isLocked: !outer1_5.can(outer1_9.CONNECT, tmp), hasVideo: outer1_7.hasVideo(channel.id), hasMedia: isGuildStageVoiceResult };
2026-07-20 16:05:17 +00:00
return obj;
});
({ hasVideo, hasMedia } = stateFromStoresObject);
2026-07-29 08:29:29 +00:00
obj = { channel, locked: stateFromStoresObject.isLocked, video: null, selected: null };
let tmp5 = hasVideo;
2026-07-20 16:05:17 +00:00
if (!hasVideo) {
2026-07-29 08:29:29 +00:00
tmp5 = hasMedia;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = tmp5;
obj[3] = selected;
if (tmp4(obj)) {
obj = { userCount: null, video: null, channel: null };
obj[0] = voiceStatesCount;
2026-07-20 16:05:17 +00:00
if (!hasVideo) {
hasVideo = hasMedia;
}
2026-07-29 08:29:29 +00:00
obj[1] = hasVideo;
obj[2] = channel;
2026-07-31 08:44:05 +00:00
let tmp6Result = tmp6(channel(15127).ConnectedUserLimit, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj1 = { channel: null };
obj1[0] = channel;
tmp6Result = tmp6(DurationInfo, obj1);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp6Result;
2026-07-20 16:05:17 +00:00
}
function DurationInfo(channel) {
2026-07-31 08:44:05 +00:00
let obj = require(15218) /* useStartTime */;
2026-07-20 16:05:17 +00:00
const startTime = obj.useStartTime(channel.channel);
2026-07-29 08:29:29 +00:00
let tmp5 = null;
2026-07-20 16:05:17 +00:00
if (null != startTime) {
2026-07-29 08:29:29 +00:00
obj = { entry: null, style: null };
obj = { start: null };
obj[0] = startTime;
obj[0] = obj;
obj[1] = tmp.activeTimestamp;
2026-07-31 08:44:05 +00:00
tmp5 = jsx(require(12013) /* ActiveTimestamp */.ActiveTimestamp, { start: null });
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp5;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ GuildFeatures: metroImportAll, Permissions: c9, Fonts } = ME);
createCacheKey = { fontFamily: Fonts.CODE_NORMAL, fontSize: 12, lineHeight: 16 };
let closure_11 = createCacheKey.createStyles({ activeTimestamp: createCacheKey });
const result = require("createGuildRecordFromRust").fileFinishedImporting("modules/guild_sidebar/native/ChannelInfo.tsx");
2026-07-20 16:05:17 +00:00
export default function ChannelInfo(channel) {
let enableActivities;
let enableConnectedUserLimit;
let guild;
let isChannelCollapsed;
let isNewChannel;
let isSubscriptionGated;
let mentionsCount;
let muted;
let needSubscriptionToAccess;
let voiceStates;
channel = channel.channel;
({ isChannelCollapsed, voiceStates, enableConnectedUserLimit, enableActivities, muted, isSubscriptionGated, needSubscriptionToAccess } = channel);
2026-07-29 08:29:29 +00:00
let obj = channel(589);
const items = [createGuildRecordFromRust, generateOldThreadCutoff, guildHasCommunity];
2026-07-23 10:11:24 +00:00
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => ({ guild: outer1_4.getGuild(channel.guild_id), mentionsCount: outer1_6.getMentionCount(channel.id), isMentionLowImportance: outer1_6.getIsMentionLowImportance(channel.id), isNewChannel: outer1_3.shouldIndicateNewChannel(channel.guild_id, channel.id) }));
2026-07-20 16:05:17 +00:00
({ guild, mentionsCount, isNewChannel } = stateFromStoresObject);
2026-07-31 08:44:05 +00:00
const tmp5 = importDefault(11247)(channel);
let obj1 = channel(5794);
2026-07-20 16:05:17 +00:00
const optInEnabledForGuild = obj1.useOptInEnabledForGuild(channel.guild_id);
2026-07-31 08:44:05 +00:00
let obj2 = channel(9142);
2026-07-29 08:29:29 +00:00
const postsWithUnreadsCount = obj2.useUnreadThreadsCountForParent(channel.guild_id, channel.id);
2026-07-31 08:44:05 +00:00
if (importDefault(15213)({ mentionsCount, isNewChannel, postsWithUnreadsCount, muted })) {
2026-07-29 08:29:29 +00:00
obj = { mentionCount: null, isMentionLowImportance: null, isNewChannel: null, postsWithUnreadsCount: null, muted: null };
obj[0] = mentionsCount;
obj[1] = stateFromStoresObject.isMentionLowImportance;
2026-07-20 16:05:17 +00:00
if (isNewChannel) {
isNewChannel = optInEnabledForGuild;
}
2026-07-29 08:29:29 +00:00
obj[2] = isNewChannel;
let tmp19 = null;
2026-07-20 16:05:17 +00:00
if (channel.isForumLikeChannel()) {
2026-07-29 08:29:29 +00:00
tmp19 = postsWithUnreadsCount;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = tmp19;
obj[4] = muted;
2026-07-31 08:44:05 +00:00
let tmp12Result = jsx(tmp4(15214), { mentionCount: null, isMentionLowImportance: null, isNewChannel: null, postsWithUnreadsCount: null, muted: null });
2026-07-29 08:29:29 +00:00
const tmp17 = jsx;
2026-07-31 08:44:05 +00:00
const tmp4Result = tmp4(15214);
2026-07-20 16:05:17 +00:00
} else {
if (null != isChannelCollapsed) {
if (isChannelCollapsed) {
let hasItem;
2026-07-29 08:29:29 +00:00
if (guild != null) {
2026-07-20 16:05:17 +00:00
const features = guild.features;
hasItem = features.has(constants.COMMUNITY);
}
2026-07-29 08:29:29 +00:00
if (hasItem) {
2026-07-31 08:44:05 +00:00
let tmpResult = tmp(4377);
2026-07-29 08:29:29 +00:00
if (tmpResult.hasStream(voiceStates)) {
tmp12Result = jsx(tmp(1297).LiveTag, {});
2026-07-20 16:05:17 +00:00
}
}
}
}
if (null != enableActivities) {
if (enableActivities) {
2026-07-31 08:44:05 +00:00
tmpResult = tmp(15216);
2026-07-29 08:29:29 +00:00
if (tmpResult.showChannelItemEmbeddedActivities(tmp5)) {
obj = { embeddedApps: null, muted: null };
obj[0] = tmp5;
obj[1] = muted;
2026-07-31 08:44:05 +00:00
tmp12Result = jsx(tmp4(15217), { embeddedApps: null, muted: null });
2026-07-20 16:05:17 +00:00
}
}
}
if (null != isSubscriptionGated) {
if (null != needSubscriptionToAccess) {
if (isSubscriptionGated) {
2026-07-29 08:29:29 +00:00
obj1 = { locked: null };
obj1[0] = needSubscriptionToAccess;
2026-07-31 08:44:05 +00:00
tmp12Result = jsx(tmp4(15126), { locked: null });
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
tmp12Result = null;
2026-07-20 16:05:17 +00:00
if (null != enableConnectedUserLimit) {
2026-07-29 08:29:29 +00:00
tmp12Result = null;
2026-07-20 16:05:17 +00:00
if (enableConnectedUserLimit) {
2026-07-29 08:29:29 +00:00
obj2 = { channel: null, voiceStatesCount: null, selected: null };
obj2[0] = channel;
let num;
if (voiceStates != null) {
num = voiceStates.length;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj2[1] = num;
obj2[2] = channel.isChannelSelected;
tmp12Result = <LimitAndDurationInfo channel={null} voiceStatesCount={null} selected={null} />;
const tmp12 = jsx;
const tmp13 = LimitAndDurationInfo;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
return tmp12Result;
2026-07-20 16:05:17 +00:00
};