decord/source/modules/guild/markGuildsAsRead.tsx

96 lines
3.6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 13478
// Function ID: 13479
2026-07-29 08:29:29 +00:00
// Name: markGuildsAsRead
2026-08-24 06:08:38 +00:00
// Dependencies: [6825, 5256, 1391, 1981, 4777, 676, 5049, 12, 11, 698, 5282, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 13478 (markGuildsAsRead)
import applyDefault from "apply" /* 12 */;
import expandEventPropertiesDefault from "expandEventProperties" /* 698 */;
import closure_3 from "handleUpdate" /* 6825 */;
import closure_4 from "rebuild" /* 5256 */;
import closure_5 from "ensureGuildLoaded" /* 1391 */;
import closure_6 from "comparator" /* 1981 */;
import closure_7 from "generateOldThreadCutoff" /* 4777 */;
import { AnalyticEvents } from "ME" /* 676 */;
import { ReadStateTypes } from "ReadStateTypes" /* 5049 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/guild/markGuildsAsRead.tsx");
2026-07-20 16:05:17 +00:00
export default function markGuildsAsRead(arr, source, onFinished) {
2026-08-24 06:08:38 +00:00
let obj = applyDefault;
2026-07-29 08:29:29 +00:00
const mapped = obj.flatMap(arr, (closure_0) => {
const selectableChannelIds = store.getSelectableChannelIds(closure_0);
const vocalChannelIds = store.getVocalChannelIds(closure_0);
2026-07-20 16:05:17 +00:00
const items = [...vocalChannelIds];
2026-07-29 08:29:29 +00:00
activeJoinedThreadsForGuild = activeJoinedThreadsForGuild.getActiveJoinedThreadsForGuild(closure_0);
const iter = selectableChannelIds[Symbol.iterator]();
while (iter !== undefined) {
let obj = activeJoinedThreadsForGuild[iter.next()];
if (obj == null) {
obj = {};
}
let tmp4 = obj;
for (const key10027 in obj) {
let tmp5 = key10027;
let arr = items.push(key10027);
continue;
}
continue;
2026-07-20 16:05:17 +00:00
}
return items;
2026-07-31 08:44:05 +00:00
}).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 = callback(table[8]).fromTimestamp(Date.now());
const obj3 = callback(table[8]);
} else {
2026-08-24 06:08:38 +00:00
fromTimestampResult = closure_7.lastMessageId(channelId);
2026-07-31 08:44:05 +00:00
}
obj[2] = fromTimestampResult;
return obj;
});
2026-07-20 16:05:17 +00:00
const item = arr.forEach((id) => {
2026-08-24 06:08:38 +00:00
let obj = { channelId: closure_1_1(closure_1_2[8]).cast(id), readStateType: closure_1_9.GUILD_EVENT, messageId: closure_1_7.lastMessageId(id, closure_1_9.GUILD_EVENT) };
2026-07-20 16:05:17 +00:00
mapped.push(obj);
2026-07-29 08:29:29 +00:00
obj = { channelId: null, readStateType: null, messageId: null };
2026-08-24 06:08:38 +00:00
const obj2 = closure_1_1(closure_1_2[8]);
obj[0] = closure_1_1(closure_1_2[8]).cast(id);
obj[1] = closure_1_9.GUILD_ONBOARDING_QUESTION;
obj[2] = closure_1_3.ackIdForGuild(id);
2026-07-20 16:05:17 +00:00
mapped.push(obj);
});
2026-07-29 08:29:29 +00:00
const flatMapResult = obj.flatMap(arr, (closure_0) => {
const selectableChannelIds = store.getSelectableChannelIds(closure_0);
const vocalChannelIds = store.getVocalChannelIds(closure_0);
2026-07-20 16:05:17 +00:00
const items = [...vocalChannelIds];
2026-07-29 08:29:29 +00:00
activeJoinedThreadsForGuild = activeJoinedThreadsForGuild.getActiveJoinedThreadsForGuild(closure_0);
const iter = selectableChannelIds[Symbol.iterator]();
while (iter !== undefined) {
let obj = activeJoinedThreadsForGuild[iter.next()];
if (obj == null) {
obj = {};
}
let tmp4 = obj;
for (const key10027 in obj) {
let tmp5 = key10027;
let arr = items.push(key10027);
continue;
}
continue;
2026-07-20 16:05:17 +00:00
}
return items;
});
obj = { source, type: "guild" };
2026-08-24 06:08:38 +00:00
expandEventPropertiesDefault.track(AnalyticEvents.MARK_AS_READ, obj);
let obj2 = expandEventPropertiesDefault;
return mapped(5282).bulkAck(mapped, onFinished);
2026-07-20 16:05:17 +00:00
};