Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
80 lines
2.6 KiB
TypeScript
80 lines
2.6 KiB
TypeScript
// Module ID: 16403
|
|
// Function ID: 16404
|
|
// Name: useActiveChannels
|
|
// Dependencies: [2049, 2045, 4399, 4939, 13974, 1078, 2052, 1374, 2]
|
|
// Exports: getActiveTextChannels
|
|
|
|
// Module 16403 (useActiveChannels)
|
|
import Constants from "Constants" /* 1078 */;
|
|
import GlobalUtils from "GlobalUtils" /* 1374 */;
|
|
import ChannelRecord from "ChannelRecord" /* 2049 */;
|
|
import ChannelConstants from "ChannelConstants" /* 2052 */;
|
|
import ChannelStore from "ChannelStore" /* 2045 */;
|
|
import PermissionStore from "PermissionStore" /* 4399 */;
|
|
import UserGuildSettingsStore from "UserGuildSettingsStore" /* 4939 */;
|
|
import ActiveChannelsStore from "ActiveChannelsStore" /* 13974 */;
|
|
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;
|
|
}
|
|
});
|
|
};
|