decord/source/modules/guild_home/useActiveChannels.tsx

79 lines
2.5 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 15074
// Function ID: 15075
2026-07-20 16:05:17 +00:00
// Name: getActiveTextChannels
2026-08-05 07:35:12 +00:00
// Dependencies: [1376, 1372, 3883, 4450, 12846, 676, 1379, 1351, 2]
2026-07-20 16:05:17 +00:00
// Exports: getActiveTextChannels
2026-08-05 07:35:12 +00:00
// Module 15074 (getActiveTextChannels)
2026-07-29 08:29:29 +00:00
import { isTextChannel } from "createChannelRecord";
import ensureGuildLoaded from "ensureGuildLoaded";
import getUncachedChannelPermissions from "getUncachedChannelPermissions";
import updateUserGuildSettingsInternal from "updateUserGuildSettingsInternal";
import truncateOldMessageData from "truncateOldMessageData";
2026-07-23 10:11:24 +00:00
import { Permissions } from "ME";
import { ChannelFlags } from "set";
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
const result = require("getUncachedChannelPermissions").fileFinishedImporting("modules/guild_home/useActiveChannels.tsx");
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
export const getActiveTextChannels = function getActiveTextChannels(guildId) {
2026-07-20 16:05:17 +00:00
let obj;
let obj2;
2026-07-29 08:29:29 +00:00
let tmp = arg1;
if (arg1 === undefined) {
let items = [ensureGuildLoaded, getUncachedChannelPermissions, truncateOldMessageData, updateUserGuildSettingsInternal];
2026-07-20 16:05:17 +00:00
tmp = items;
}
[, , obj, obj2] = tmp;
let mutedChannels;
2026-07-29 08:29:29 +00:00
const activeChannelIds = obj.getActiveChannelIds(guildId);
2026-07-20 16:05:17 +00:00
if (null != activeChannelIds) {
const _Array = Array;
items = Array.from(activeChannelIds);
} else {
items = [];
}
2026-07-29 08:29:29 +00:00
mutedChannels = obj2.getMutedChannels(guildId);
const mapped = items.map((arg0) => store.getChannel(arg0));
const found = mapped.filter(require(1351) /* isDiscordFrontendDevelopment */.isNotNullish);
2026-07-20 16:05:17 +00:00
return found.filter((hasFlag) => {
2026-07-29 08:29:29 +00:00
let hasFlagResult;
if (hasFlag != null) {
hasFlagResult = hasFlag.hasFlag(outer1_8.ACTIVE_CHANNELS_REMOVED);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (hasFlagResult) {
return false;
} else if (set(hasFlag.type)) {
2026-07-20 16:05:17 +00:00
if (set.has(hasFlag.id)) {
return false;
} else {
if (null != hasFlag.parent_id) {
2026-07-29 08:29:29 +00:00
if (obj.has(hasFlag.parent_id)) {
2026-07-20 16:05:17 +00:00
return false;
}
}
2026-07-23 10:11:24 +00:00
if (closure_1.can(outer1_7.VIEW_CHANNEL, hasFlag)) {
2026-07-20 16:05:17 +00:00
const channel = store.getChannel(hasFlag.parent_id);
2026-07-29 08:29:29 +00:00
const isThreadResult = hasFlag.isThread();
let tmp8 = !isThreadResult;
if (isThreadResult) {
tmp8 = null == channel;
}
if (!tmp8) {
let hasFlagResult1;
if (channel != null) {
hasFlagResult1 = channel.hasFlag(outer1_8.ACTIVE_CHANNELS_REMOVED);
}
tmp8 = !hasFlagResult1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp8;
2026-07-20 16:05:17 +00:00
} else {
return false;
}
}
2026-07-29 08:29:29 +00:00
obj = set;
2026-07-20 16:05:17 +00:00
} else {
return false;
}
});
};