decord/source/modules/threads/getThreadAutoArchiveTimeOnce.tsx

68 lines
2.4 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 5098
// Function ID: 5099
// Name: getThreadAutoArchiveTimeOnce
// Dependencies: [4201, 687, 11, 2]
// Exports: default, getThreadLastActivityTime
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
// Module 5098 (getThreadAutoArchiveTimeOnce)
import generateOldThreadCutoff from "generateOldThreadCutoff";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let result = require("DISCORD_EPOCH").fileFinishedImporting("modules/threads/getThreadAutoArchiveTimeOnce.tsx");
export default function getThreadAutoArchiveTimeOnce(threadMetadata) {
if (null == threadMetadata.threadMetadata) {
return 0;
} else {
let num3 = 0;
const result = threadMetadata.threadMetadata.autoArchiveDuration * importDefault(687).Millis.MINUTE;
if (null != threadMetadata.threadMetadata) {
let id = generateOldThreadCutoff.lastMessageId(threadMetadata.id);
if (id == null) {
id = threadMetadata.id;
}
let num = 0;
const tmp12Result = importDefault(11);
if (null != threadMetadata.lastNonMessageActivityTimestamp) {
const _Date = Date;
const date = new Date(threadMetadata.lastNonMessageActivityTimestamp);
num = date.getTime();
}
let num2 = 0;
if (null != threadMetadata.threadMetadata.archiveTimestamp) {
const _Date2 = Date;
const date1 = new Date(threadMetadata.threadMetadata.archiveTimestamp);
num2 = date1.getTime();
}
const _Math = Math;
num3 = Math.max(importDefault(11).extractTimestamp(id), num, num2);
const extractTimestampResult = importDefault(11).extractTimestamp(id);
}
return num3 + result;
}
};
export const getThreadLastActivityTime = function getThreadLastActivityTime(threadMetadata) {
2026-07-20 16:05:17 +00:00
if (null == threadMetadata.threadMetadata) {
return 0;
} else {
2026-07-29 08:29:29 +00:00
let id = generateOldThreadCutoff.lastMessageId(threadMetadata.id);
if (id == null) {
2026-07-20 16:05:17 +00:00
id = threadMetadata.id;
}
2026-07-29 08:29:29 +00:00
let num = 0;
const obj = importDefault(11);
2026-07-21 06:55:02 +00:00
if (null != threadMetadata.lastNonMessageActivityTimestamp) {
2026-07-20 16:05:17 +00:00
const _Date = Date;
2026-07-21 06:55:02 +00:00
const date = new Date(threadMetadata.lastNonMessageActivityTimestamp);
2026-07-29 08:29:29 +00:00
num = date.getTime();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let num2 = 0;
2026-07-21 06:55:02 +00:00
if (null != threadMetadata.threadMetadata.archiveTimestamp) {
const _Date2 = Date;
const date1 = new Date(threadMetadata.threadMetadata.archiveTimestamp);
2026-07-29 08:29:29 +00:00
num2 = date1.getTime();
2026-07-21 06:55:02 +00:00
}
2026-07-20 16:05:17 +00:00
const _Math = Math;
2026-07-29 08:29:29 +00:00
return Math.max(importDefault(11).extractTimestamp(id), num, num2);
2026-07-20 16:05:17 +00:00
}
};