// Module ID: 11380 // Function ID: 11381 // Name: optIntoAllChannelsForExistingMember // Dependencies: [1339, 1981, 1991, 4702, 4108, 7290, 1398, 5490, 5481, 1305, 2] // Exports: hasClearedGuildOnboardingNotice, hasNotSetUpChannelOptIn, toggleShowAllChannels // Module 11380 (optIntoAllChannelsForExistingMember) import create from "create" /* 1305 */; import hasFlag from "hasFlag" /* 1398 */; import useOptInEnabledForGuild from "useOptInEnabledForGuild" /* 7290 */; 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" /* 4702 */; 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(5481); 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(1398); 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(7290); const result1 = tmpResult.isOptInEnabledForGuild(id); tmp(5490).setGuildOptIn(id, !result1); const tmpResult1 = tmp(5490); } }; 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; };