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

164 lines
6.2 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 15552
// Function ID: 15553
2026-07-20 16:05:17 +00:00
// Name: LimitAndDurationInfo
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 5281, 1910, 4024, 4777, 4547, 676, 21, 4668, 589, 11284, 8552, 15553, 15554, 4985, 1297, 15556, 15557, 15444, 4993, 11510, 15445, 15558, 12157, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 15552 (LimitAndDurationInfo)
import noopAll from "noop" /* 19 */;
import useEmbeddedAppsDefault from "useEmbeddedApps" /* 11284 */;
import ActiveTimestamp from "ActiveTimestamp" /* 12157 */;
import showChannelBadgeDefault from "showChannelBadge" /* 15553 */;
import useStartTime from "useStartTime" /* 15558 */;
import closure_3 from "guildHasCommunity" /* 5281 */;
import closure_4 from "createGuildRecordFromRust" /* 1910 */;
import closure_5 from "getUncachedChannelPermissions" /* 4024 */;
import closure_6 from "generateOldThreadCutoff" /* 4777 */;
import closure_7 from "updateVoiceState" /* 4547 */;
import ME from "ME" /* 676 */;
import { jsx } from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function LimitAndDurationInfo(channel) {
channel = channel.channel;
({ voiceStatesCount, selected } = channel);
2026-07-29 08:29:29 +00:00
let obj = channel(589);
2026-08-24 06:08:38 +00:00
const items = [closure_7, closure_5];
2026-07-20 16:05:17 +00:00
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => {
let isGuildStageVoiceResult = channel.isGuildStageVoice();
if (isGuildStageVoiceResult) {
2026-08-24 06:08:38 +00:00
let obj = channel(closure_1_2[19]);
2026-07-29 08:29:29 +00:00
isGuildStageVoiceResult = obj.getStageHasMedia(tmp.id);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
obj = { isLocked: !closure_1_5.can(closure_1_9.CONNECT, tmp), hasVideo: closure_1_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-08-24 06:08:38 +00:00
let tmp6Result = tmp6(channel(15445).ConnectedUserLimit, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
obj1 = { channel: null };
2026-07-29 08:29:29 +00:00
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-08-24 06:08:38 +00:00
let obj = 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-08-24 06:08:38 +00:00
tmp5 = jsx(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-08-24 06:08:38 +00:00
noopAll;
({ GuildFeatures: closure_8, Permissions: c9, Fonts } = ME);
2026-07-29 08:29:29 +00:00
createCacheKey = { fontFamily: Fonts.CODE_NORMAL, fontSize: 12, lineHeight: 16 };
let closure_11 = createCacheKey.createStyles({ activeTimestamp: createCacheKey });
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/guild_sidebar/native/ChannelInfo.tsx");
2026-07-20 16:05:17 +00:00
export default function ChannelInfo(channel) {
channel = channel.channel;
({ isChannelCollapsed, voiceStates, enableConnectedUserLimit, enableActivities, muted, isSubscriptionGated, needSubscriptionToAccess } = channel);
2026-07-29 08:29:29 +00:00
let obj = channel(589);
2026-08-24 06:08:38 +00:00
const items = [closure_4, closure_6, closure_3];
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => ({ guild: closure_1_4.getGuild(channel.guild_id), mentionsCount: closure_1_6.getMentionCount(channel.id), isMentionLowImportance: closure_1_6.getIsMentionLowImportance(channel.id), isNewChannel: closure_1_3.shouldIndicateNewChannel(channel.guild_id, channel.id) }));
2026-07-20 16:05:17 +00:00
({ guild, mentionsCount, isNewChannel } = stateFromStoresObject);
2026-08-24 06:08:38 +00:00
const tmp5 = useEmbeddedAppsDefault(channel);
obj1 = channel(8552);
2026-08-03 11:20:01 +00:00
const postsWithUnreadsCount = obj1.useUnreadThreadsCountForParent(channel.guild_id, channel.id);
2026-08-24 06:08:38 +00:00
if (showChannelBadgeDefault({ 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;
obj[2] = isNewChannel;
2026-08-03 11:20:01 +00:00
let tmp18 = null;
2026-07-20 16:05:17 +00:00
if (channel.isForumLikeChannel()) {
2026-08-03 11:20:01 +00:00
tmp18 = postsWithUnreadsCount;
2026-07-20 16:05:17 +00:00
}
2026-08-03 11:20:01 +00:00
obj[3] = tmp18;
2026-07-29 08:29:29 +00:00
obj[4] = muted;
2026-08-24 06:08:38 +00:00
let tmp11Result = jsx(tmp4(15554), { mentionCount: null, isMentionLowImportance: null, isNewChannel: null, postsWithUnreadsCount: null, muted: null });
2026-08-03 11:20:01 +00:00
const tmp16 = jsx;
2026-08-24 06:08:38 +00:00
const tmp4Result = tmp4(15554);
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-08-24 06:08:38 +00:00
let tmpResult = tmp(4985);
2026-07-29 08:29:29 +00:00
if (tmpResult.hasStream(voiceStates)) {
2026-08-03 11:20:01 +00:00
tmp11Result = jsx(tmp(1297).LiveTag, {});
2026-07-20 16:05:17 +00:00
}
}
}
}
if (null != enableActivities) {
if (enableActivities) {
2026-08-24 06:08:38 +00:00
tmpResult = tmp(15556);
2026-07-29 08:29:29 +00:00
if (tmpResult.showChannelItemEmbeddedActivities(tmp5)) {
obj = { embeddedApps: null, muted: null };
obj[0] = tmp5;
obj[1] = muted;
2026-08-24 06:08:38 +00:00
tmp11Result = jsx(tmp4(15557), { 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-08-24 06:08:38 +00:00
tmp11Result = jsx(tmp4(15444), { locked: null });
2026-07-20 16:05:17 +00:00
}
}
}
2026-08-03 11:20:01 +00:00
tmp11Result = null;
2026-07-20 16:05:17 +00:00
if (null != enableConnectedUserLimit) {
2026-08-03 11:20:01 +00:00
tmp11Result = null;
2026-07-20 16:05:17 +00:00
if (enableConnectedUserLimit) {
2026-08-03 11:20:01 +00:00
const obj2 = { channel: null, voiceStatesCount: null, selected: null };
2026-07-29 08:29:29 +00:00
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;
2026-08-03 11:20:01 +00:00
tmp11Result = <LimitAndDurationInfo channel={null} voiceStatesCount={null} selected={null} />;
const tmp11 = jsx;
const tmp12 = LimitAndDurationInfo;
2026-07-20 16:05:17 +00:00
}
}
}
2026-08-03 11:20:01 +00:00
return tmp11Result;
2026-07-20 16:05:17 +00:00
};