decord/source/modules/guild_home/useActiveChannels.tsx
github-actions 4f02868c60 chore: update source for alpha 346.4
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
2026-09-11 10:30:06 +00:00

80 lines
2.6 KiB
TypeScript

// Module ID: 16137
// Function ID: 16138
// Name: useActiveChannels
// Dependencies: [1961, 1957, 4245, 4788, 13762, 1074, 1964, 1369, 2]
// Exports: getActiveTextChannels
// Module 16137 (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" /* 4245 */;
import UserGuildSettingsStore from "UserGuildSettingsStore" /* 4788 */;
import ActiveChannelsStore from "ActiveChannelsStore" /* 13762 */;
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;
}
});
};