decord/source/modules/app_analytics/ThreadAnalyticsUtils.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

69 lines
2.4 KiB
TypeScript

// Module ID: 7774
// Function ID: 7775
// Name: collectThreadMetadata
// Dependencies: [7770, 7306, 1961, 4199, 1074, 1100, 11, 2]
// Exports: collectThreadMetadata
// Module 7774 (collectThreadMetadata)
import DISCORD_EPOCHDefault from "DISCORD_EPOCH" /* 11 */;
import transitionTo from "transitionTo" /* 1100 */;
import closure_3 from "updateFromGuild" /* 7770 */;
import closure_4 from "updateState" /* 7306 */;
import { THREAD_CHANNEL_TYPES } from "createChannelRecord" /* 1961 */;
import closure_6 from "getUncachedChannelPermissions" /* 4199 */;
import { Permissions } from "ME" /* 1074 */;
require = arg1;
const result = require("set").fileFinishedImporting("modules/app_analytics/ThreadAnalyticsUtils.tsx");
export const collectThreadMetadata = function collectThreadMetadata(channel, arg1) {
let flag = arg1;
if (arg1 === undefined) {
flag = false;
}
let tmp = null;
if (null != channel) {
tmp = null;
if (THREAD_CHANNEL_TYPES.has(channel.type)) {
let lastRouteChangeSource;
if (flag) {
let obj = transitionTo;
lastRouteChangeSource = obj.getLastRouteChangeSource();
}
obj = { location: null, thread_approximate_member_count: null, thread_approximate_message_count: null, thread_archived: null, thread_locked: null, thread_auto_archive_duration_minutes: null, thread_approximate_creation_date: null, can_send_message: null, parent_channel_type: null };
obj[0] = lastRouteChangeSource;
obj[1] = memberCount.getMemberCount(channel.id);
obj[2] = count.getCount(channel.id);
const threadMetadata = channel.threadMetadata;
let archived;
if (threadMetadata != null) {
archived = threadMetadata.archived;
}
obj[3] = true === archived;
const threadMetadata2 = channel.threadMetadata;
let flag3;
if (threadMetadata2 != null) {
flag3 = threadMetadata2.locked;
}
if (flag3 == null) {
flag3 = false;
}
obj[4] = flag3;
const threadMetadata3 = channel.threadMetadata;
let num;
if (threadMetadata3 != null) {
num = threadMetadata3.autoArchiveDuration;
}
if (num == null) {
num = 0;
}
obj[5] = num;
obj[6] = DISCORD_EPOCHDefault.extractTimestamp(channel.id);
obj[7] = closure_6.can(Permissions.SEND_MESSAGES, channel);
obj[8] = channel.parentChannelThreadType;
tmp = obj;
const obj3 = DISCORD_EPOCHDefault;
}
}
return tmp;
};