// Module ID: 10786 // Function ID: 10787 // Name: optIntoAllChannelsForExistingMember // Dependencies: [1340, 1981, 1991, 5048, 4012, 5287, 1403, 6831, 6828, 1306, 2] // Exports: hasClearedGuildOnboardingNotice, hasNotSetUpChannelOptIn, toggleShowAllChannels // Module 10786 (optIntoAllChannelsForExistingMember) import create from "create" /* 1306 */; import hasFlag from "hasFlag" /* 1403 */; import useOptInEnabledForGuild from "useOptInEnabledForGuild" /* 5287 */; import closure_3 from "handleConnectionClosedOrResumed" /* 1340 */; import comparator from "comparator" /* 1981 */; import closure_6 from "comparator" /* 1981 */; import closure_7 from "trackCommunicationDisabled" /* 1991 */; import closure_8 from "updateUserGuildSettingsInternal" /* 5048 */; import { GuildMemberFlags } from "GuildMemberFlags" /* 4012 */; 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(6828); 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(1403); 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(5287); const result1 = tmpResult.isOptInEnabledForGuild(id); tmp(6831).setGuildOptIn(id, !result1); const tmpResult1 = tmp(6831); } }; 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; };