// Module ID: 14048 // Function ID: 14049 // Name: markGuildsAsRead // Dependencies: [7203, 5587, 1957, 2012, 4651, 1074, 4818, 12, 11, 1240, 7213, 2] // Exports: default // Module 14048 (markGuildsAsRead) import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */; import _modDef12 from "module_12" /* 12 */; import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1240 */; import GuildOnboardingPromptsStore from "GuildOnboardingPromptsStore" /* 7203 */; import ActiveJoinedThreadsStore from "ActiveJoinedThreadsStore" /* 5587 */; import ChannelStore from "ChannelStore" /* 1957 */; import GuildChannelStore from "GuildChannelStore" /* 2012 */; import ReadStateStore from "ReadStateStore" /* 4651 */; const require = fn; const AnalyticEvents = fn(1074).AnalyticEvents; const ReadStateTypes = fn(4818).ReadStateTypes; const size = fn(2); const result = size.fileFinishedImporting("modules/guild/markGuildsAsRead.tsx"); export default function markGuildsAsRead(arr, source, onFinished) { const mapped = _modDef12.flatMap(arr, (guildId) => { const selectableChannelIds = GuildChannelStore.getSelectableChannelIds(guildId); const vocalChannelIds = GuildChannelStore.getVocalChannelIds(guildId); const items = [...vocalChannelIds]; activeJoinedThreadsForGuild = activeJoinedThreadsForGuild.getActiveJoinedThreadsForGuild(guildId); const iter = selectableChannelIds[Symbol.iterator](); while (iter !== undefined) { let obj = activeJoinedThreadsForGuild[iter.next()]; if (obj == null) { obj = {}; } for (const key10027 in obj) { let arr = items.push(key10027); continue; } continue; } return items; }).map((channelId) => { const obj = { channelId, readStateType: constants.CHANNEL, messageId: null }; channel = channel.getChannel(channelId); let isForumLikeChannelResult; if (channel != null) { isForumLikeChannelResult = channel.isForumLikeChannel(); } if (isForumLikeChannelResult) { const _Date = Date; let fromTimestampResult = SnowflakeUtilsDefault.fromTimestamp(Date.now()); } else { fromTimestampResult = ReadStateStore.lastMessageId(channelId); } obj.messageId = fromTimestampResult; return obj; }); const item = arr.forEach((item) => { const obj = { channelId: SnowflakeUtilsDefault.cast(item), readStateType: ReadStateTypes.GUILD_EVENT, messageId: ReadStateStore.lastMessageId(item, ReadStateTypes.GUILD_EVENT) }; mapped.push(obj); const obj3 = { channelId: null, readStateType: null, messageId: null }; obj3.channelId = SnowflakeUtilsDefault.cast(item); obj3.readStateType = ReadStateTypes.GUILD_ONBOARDING_QUESTION; obj3.messageId = GuildOnboardingPromptsStore.ackIdForGuild(item); mapped.push(obj3); }); const flatMapResult = _modDef12.flatMap(arr, (guildId) => { const selectableChannelIds = GuildChannelStore.getSelectableChannelIds(guildId); const vocalChannelIds = GuildChannelStore.getVocalChannelIds(guildId); const items = [...vocalChannelIds]; activeJoinedThreadsForGuild = activeJoinedThreadsForGuild.getActiveJoinedThreadsForGuild(guildId); const iter = selectableChannelIds[Symbol.iterator](); while (iter !== undefined) { let obj = activeJoinedThreadsForGuild[iter.next()]; if (obj == null) { obj = {}; } for (const key10027 in obj) { let arr = items.push(key10027); continue; } continue; } return items; }); AnalyticsUtilsDefault.track(AnalyticEvents.MARK_AS_READ, { source, type: "guild" }); let obj3 = { source, type: "guild" }; return mapped(7213).bulkAck(mapped, onFinished); };