decord/source/modules/opt_in_channels/OptInOnboardingUtils.tsx
github-actions 7450227d0b chore: update source for alpha 345.4
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9596_m.js (380.6 MB)
2026-09-04 17:41:35 +00:00

129 lines
3.9 KiB
TypeScript

// Module ID: 11487
// Function ID: 11488
// Name: optIntoAllChannelsForExistingMember
// Dependencies: [1339, 1981, 1991, 4709, 4108, 7468, 1399, 7053, 7045, 1305, 2]
// Exports: hasClearedGuildOnboardingNotice, hasNotSetUpChannelOptIn, toggleShowAllChannels
// Module 11487 (optIntoAllChannelsForExistingMember)
import create from "create" /* 1305 */;
import hasFlag from "hasFlag" /* 1399 */;
import useOptInEnabledForGuild from "useOptInEnabledForGuild" /* 7468 */;
import closure_3 from "handleConnectionClosedOrResumed" /* 1339 */;
import comparator from "comparator" /* 1981 */;
import closure_6 from "comparator" /* 1981 */;
import closure_7 from "trackCommunicationDisabled" /* 1991 */;
import closure_8 from "updateUserGuildSettingsInternal" /* 4709 */;
import { GuildMemberFlags } from "GuildMemberFlags" /* 4108 */;
require = arg1;
function optIntoAllChannelsForExistingMember(id, arg1) {
let obj = arg1;
if (arg1 === undefined) {
obj = {};
}
let include = obj.include;
if (include === undefined) {
const _Set = Set;
include = new Set();
}
let exclude = obj.exclude;
if (exclude === undefined) {
const _Set2 = Set;
exclude = new Set();
}
let mapped;
channels = channels.getChannels(id);
const items = [...channels[closure_5]];
const found = items.filter((channel) => {
channel = channel.channel;
const isThreadResult = channel.isThread();
let tmp2 = !isThreadResult;
if (!isThreadResult) {
tmp2 = !exclude.has(channel.id);
}
return tmp2;
});
mapped = found.map((channel) => channel.channel.id);
const item = include.forEach((arg0) => mapped.push(arg0));
const obj2 = mapped(7045);
const result = obj2.onboardExistingMember(id, new Set(mapped));
}
({ GUILD_SELECTABLE_CHANNELS_KEY: c4, GUILD_VOCAL_CHANNELS_KEY: c5 } = comparator);
let result = require("set").fileFinishedImporting("modules/opt_in_channels/OptInOnboardingUtils.tsx");
export const hasNotSetUpChannelOptIn = function hasNotSetUpChannelOptIn(guildId) {
const result = useOptInEnabledForGuild.isOptInEnabledForGuild(guildId);
const selfMember = store.getSelfMember(guildId);
let num;
if (selfMember != null) {
num = selfMember.flags;
}
if (num == null) {
num = 0;
}
const obj = useOptInEnabledForGuild;
const tmp = require;
const tmpResult = hasFlag;
let tmp7 = !result;
const hasFlagResult = hasFlag.hasFlag(num, GuildMemberFlags.COMPLETED_ONBOARDING);
if (!result) {
tmp7 = !hasFlagResult;
}
if (tmp7) {
tmp7 = !tmp6;
}
return tmp7;
};
export const toggleShowAllChannels = function toggleShowAllChannels(id) {
const result = useOptInEnabledForGuild.isOptInEnabledForGuild(id);
const selfMember = store.getSelfMember(id);
let num;
if (selfMember != null) {
num = selfMember.flags;
}
if (num == null) {
num = 0;
}
let tmpResult = tmp(1399);
const obj = useOptInEnabledForGuild;
let tmp7 = !result;
const hasFlagResult = tmpResult.hasFlag(num, GuildMemberFlags.COMPLETED_ONBOARDING);
if (!result) {
tmp7 = !hasFlagResult;
}
if (tmp7) {
tmp7 = !tmp6;
}
if (tmp7) {
optIntoAllChannelsForExistingMember(id);
} else {
tmpResult = tmp(7468);
const result1 = tmpResult.isOptInEnabledForGuild(id);
tmp(7053).setGuildOptIn(id, !result1);
const tmpResult1 = tmp(7053);
}
};
export { optIntoAllChannelsForExistingMember };
export const hasClearedGuildOnboardingNotice = function hasClearedGuildOnboardingNotice(arg0) {
let tmp = arg1;
if (arg1 === undefined) {
tmp = closure_3;
}
let hasFlagResult = null != arg0;
if (hasFlagResult) {
const guilds = tmp.settings.guilds;
let num;
if (guilds != null) {
if (guilds.guilds[arg0] != null) {
num = tmp5.guildOnboardingProgress;
}
}
if (num == null) {
num = 0;
}
hasFlagResult = hasFlag.hasFlag(num, create.GuildOnboardingProgress.GUILD_NOTICE_CLEARED);
const obj = hasFlag;
const tmp3 = require;
}
return hasFlagResult;
};