Files
discord-decomp/sources/modules/threads/getThreadAutoArchiveTimeOnce.tsx
2026-07-28 01:06:53 +03:00

47 lines
2.4 KiB
TypeScript

/* Metro module 5089; source: modules/threads/getThreadAutoArchiveTimeOnce.tsx; dependencies: [4605, 672, 21, 2] */
import SnowflakeUtils from '../../utils/SnowflakeUtils.tsx'; /* Metro dependency 21 */
import ReadStateStore from '../../stores/ReadStateStore.tsx'; /* Metro dependency 4605 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun44190(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#44190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5267:6, offset: 0x0116a088, size: 129 bytes, params: 8, frame: 19
const getThreadLastActivityTime2 = getThreadLastActivityTime;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/threads/getThreadAutoArchiveTimeOnce.tsx');
exports.default = function(a0) {
if (a0.threadMetadata == null) {
return 0;
}
return getThreadLastActivityTime(a0) + a0.threadMetadata.autoArchiveDuration * importDefault(dependencyMap[1]).Millis.MINUTE;
};
exports.getThreadLastActivityTime = getThreadLastActivityTime2;
function getThreadLastActivityTime(a0) { // fn#44191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5267:106, offset: 0x0116a109, size: 179 bytes, params: 2, frame: 15
var r2;
var Date;
var value4;
var date;
if (a0.threadMetadata == null) {
return 0;
}
const readStateStoreBinding = ReadStateStore;
const r4 = readStateStoreBinding.lastMessageId(a0.id) ?? a0.id;
let value = SnowflakeUtils;
value = value.extractTimestamp(r4);
let archiveTimestamp = a0.threadMetadata.archiveTimestamp;
if (archiveTimestamp != null) {
Date = global.Date;
archiveTimestamp = a0.threadMetadata.archiveTimestamp;
value4 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date(archiveTimestamp);
r2 = (date instanceof Object ? date : value4).getTime();
} else {
r2 = 0;
}
const Math = global.Math;
return Math.max(value, r2);
}
}
global.__d(_fun44190, 5089, [4605, 672, 21, 2]) /* metro module 5089, dependencies: [4605, 672, 21, 2] */;