Files
discord-decomp/modules/guild_scheduled_events/GuildScheduledEventUtils.tsx
T
2026-11-01 12:12:55 +02:00

41 lines
1.4 KiB
TypeScript

// Metro module 8323 (f8324).
import { ACKED_RECENTLY_WINDOW_DAYS, EVENT_STARTING_SOON_WINDOW_MILLISECONDS, NEW_EVENT_WINDOW_MILLISECONDS, UpcomingGuildEventNoticeTypes } from "./GuildScheduledEventsConstants";
import Module3771 from "../../_bundle/Module3771";
import SnowflakeUtils from "../../utils/SnowflakeUtils";
export function getNextShownUpcomingEventNoticeType(a0, a1, a2, a3) {
let r57;
const r12 = Module3771();
const time = new Date(a0.scheduled_start_time).getTime();
const r24 = time - EVENT_STARTING_SOON_WINDOW_MILLISECONDS;
if (r12.isBetween(r24, time)) {
if (a1 != null) {
L14: {
const r45 = Module3771(a1);
const isBetween = r45.isBetween(r24, time);
const isBetween2 = r45.isBetween(Module3771(time).subtract(ACKED_RECENTLY_WINDOW_DAYS, "days"), time);
r57 = void 0;
if (!isBetween) {
if (isBetween2) {
r57 = void 0;
if (!a3) {
break L14;
}
}
r57 = UpcomingGuildEventNoticeTypes.EVENT_STARTING_SOON;
}
}
return r57;
}
return UpcomingGuildEventNoticeTypes.EVENT_STARTING_SOON;
}
let r14 = a2;
const r30 = SnowflakeUtils.extractTimestamp(a0.id);
const r31 = Math;
if (a2 == null) {
r14 = r30;
}
if (r12.isBetween(r30, r31.min(r14 + NEW_EVENT_WINDOW_MILLISECONDS, time)) && a1 == null && !a3) {
return UpcomingGuildEventNoticeTypes.NEW_EVENT;
}
}