decord/source/modules/guild_home/useActiveChannels.tsx
github-actions a36fe4ec9c chore: update source for alpha 347.0
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-14 20:04:03 +00:00

80 lines
2.6 KiB
TypeScript

// Module ID: 16163
// Function ID: 16164
// Name: useActiveChannels
// Dependencies: [1961, 1957, 4275, 4817, 13795, 1074, 1964, 1369, 2]
// Exports: getActiveTextChannels
// Module 16163 (useActiveChannels)
import Constants from "Constants" /* 1074 */;
import GlobalUtils from "GlobalUtils" /* 1369 */;
import ChannelRecord from "ChannelRecord" /* 1961 */;
import ChannelConstants from "ChannelConstants" /* 1964 */;
import ChannelStore from "ChannelStore" /* 1957 */;
import PermissionStore from "PermissionStore" /* 4275 */;
import UserGuildSettingsStore from "UserGuildSettingsStore" /* 4817 */;
import ActiveChannelsStore from "ActiveChannelsStore" /* 13795 */;
import size from "module_2" /* 2 */;
const isTextChannel = ChannelRecord.isTextChannel;
const Permissions = Constants.Permissions;
const ChannelFlags = ChannelConstants.ChannelFlags;
const result = size.fileFinishedImporting("modules/guild_home/useActiveChannels.tsx");
export const getActiveTextChannels = function getActiveTextChannels(guildId) {
let tmp = arg1;
if (arg1 === undefined) {
const items = [ChannelStore, PermissionStore, ActiveChannelsStore, UserGuildSettingsStore];
tmp = items;
}
[, , obj, obj2] = tmp;
const activeChannelIds = obj.getActiveChannelIds(guildId);
if (null != activeChannelIds) {
const _Array = Array;
let arr = Array.from(activeChannelIds);
} else {
arr = [];
}
obj2.getMutedChannels(guildId);
const mapped = arr.map((item) => require.getChannel(item));
const found = mapped.filter(GlobalUtils.isNotNullish);
return found.filter((hasFlag) => {
let hasFlagResult;
if (hasFlag != null) {
hasFlagResult = hasFlag.hasFlag(ChannelFlags.ACTIVE_CHANNELS_REMOVED);
}
if (hasFlagResult) {
return false;
} else if (isTextChannel(hasFlag.type)) {
if (set.has(hasFlag.id)) {
return false;
} else {
if (null != hasFlag.parent_id) {
if (obj.has(hasFlag.parent_id)) {
return false;
}
}
if (dependencyMap.can(Permissions.VIEW_CHANNEL, hasFlag)) {
const channel = require.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(ChannelFlags.ACTIVE_CHANNELS_REMOVED);
}
tmp8 = !hasFlagResult1;
}
return tmp8;
} else {
return false;
}
}
obj = set;
} else {
return false;
}
});
};