decord/source/modules/guild_home/useActiveChannels.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

81 lines
2.6 KiB
TypeScript

// Module ID: 16066
// Function ID: 16067
// Name: getActiveTextChannels
// Dependencies: [1961, 1957, 4199, 4741, 13705, 1074, 1964, 1369, 2]
// Exports: getActiveTextChannels
// Module 16066 (getActiveTextChannels)
import set from "set" /* 2 */;
import ME from "ME" /* 1074 */;
import isDiscordFrontendDevelopment from "isDiscordFrontendDevelopment" /* 1369 */;
import createChannelRecord from "createChannelRecord" /* 1961 */;
import set2 from "set" /* 1964 */;
import closure_3 from "ensureGuildLoaded" /* 1957 */;
import closure_4 from "getUncachedChannelPermissions" /* 4199 */;
import closure_5 from "updateUserGuildSettingsInternal" /* 4741 */;
import closure_6 from "truncateOldMessageData" /* 13705 */;
const isTextChannel = createChannelRecord.isTextChannel;
const Permissions = ME.Permissions;
const ChannelFlags = set2.ChannelFlags;
const result = set.fileFinishedImporting("modules/guild_home/useActiveChannels.tsx");
export const getActiveTextChannels = function getActiveTextChannels(guildId) {
let tmp = arg1;
if (arg1 === undefined) {
let items = [closure_3, closure_4, closure_6, closure_5];
tmp = items;
}
[, , obj, obj2] = tmp;
let mutedChannels;
const activeChannelIds = obj.getActiveChannelIds(guildId);
if (null != activeChannelIds) {
const _Array = Array;
items = Array.from(activeChannelIds);
} else {
items = [];
}
mutedChannels = obj2.getMutedChannels(guildId);
const mapped = items.map((arg0) => store.getChannel(arg0));
const found = mapped.filter(isDiscordFrontendDevelopment.isNotNullish);
return found.filter((hasFlag) => {
let hasFlagResult;
if (hasFlag != null) {
hasFlagResult = hasFlag.hasFlag(closure_1_8.ACTIVE_CHANNELS_REMOVED);
}
if (hasFlagResult) {
return false;
} else if (set(hasFlag.type)) {
if (set.has(hasFlag.id)) {
return false;
} else {
if (null != hasFlag.parent_id) {
if (obj.has(hasFlag.parent_id)) {
return false;
}
}
if (closure_1.can(closure_1_7.VIEW_CHANNEL, hasFlag)) {
const channel = store.getChannel(hasFlag.parent_id);
const isThreadResult = hasFlag.isThread();
let tmp8 = !isThreadResult;
if (isThreadResult) {
tmp8 = null == channel;
}
if (!tmp8) {
let hasFlagResult1;
if (channel != null) {
hasFlagResult1 = channel.hasFlag(closure_1_8.ACTIVE_CHANNELS_REMOVED);
}
tmp8 = !hasFlagResult1;
}
return tmp8;
} else {
return false;
}
}
obj = set;
} else {
return false;
}
});
};