decord/source/modules/threads/getThreadAutoArchiveTimeOnce.tsx

46 lines
1.5 KiB
TypeScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 5041
// Function ID: 43564
2026-07-20 16:05:17 +00:00
// Name: getThreadLastActivityTime
2026-07-23 10:11:24 +00:00
// Dependencies: [4142, 664, 21, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-23 10:11:24 +00:00
// Module 5041 (getThreadLastActivityTime)
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
2026-07-20 16:05:17 +00:00
function getThreadLastActivityTime(threadMetadata) {
if (null == threadMetadata.threadMetadata) {
return 0;
} else {
2026-07-23 10:11:24 +00:00
let id = _isNativeReflectConstruct.lastMessageId(threadMetadata.id);
2026-07-20 16:05:17 +00:00
if (null == id) {
id = threadMetadata.id;
}
let num2 = 0;
2026-07-23 10:11:24 +00:00
const obj = importDefault(21);
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-20 16:05:17 +00:00
num2 = date.getTime();
}
2026-07-21 06:55:02 +00:00
let num3 = 0;
if (null != threadMetadata.threadMetadata.archiveTimestamp) {
const _Date2 = Date;
const date1 = new Date(threadMetadata.threadMetadata.archiveTimestamp);
num3 = date1.getTime();
}
2026-07-20 16:05:17 +00:00
const _Math = Math;
2026-07-23 10:11:24 +00:00
return Math.max(importDefault(21).extractTimestamp(id), num2, num3);
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
let result = require("DISCORD_EPOCH").fileFinishedImporting("modules/threads/getThreadAutoArchiveTimeOnce.tsx");
2026-07-20 16:05:17 +00:00
export default function getThreadAutoArchiveTimeOnce(threadMetadata) {
if (null == threadMetadata.threadMetadata) {
return 0;
} else {
2026-07-23 10:11:24 +00:00
const result = threadMetadata.threadMetadata.autoArchiveDuration * importDefault(664).Millis.MINUTE;
2026-07-20 16:05:17 +00:00
return getThreadLastActivityTime(threadMetadata) + result;
}
};
export { getThreadLastActivityTime };