2026-10-12 16:32:48 +00:00
|
|
|
// Module ID: 6805
|
|
|
|
|
// Function ID: 6806
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: LastMentionTimestampStore
|
2026-10-12 16:32:48 +00:00
|
|
|
// Dependencies: [2125, 5966, 1390, 584, 504, 2]
|
2026-09-18 19:45:33 +00:00
|
|
|
// Exports: trackMessageNotificationTimestamps
|
|
|
|
|
|
2026-10-12 16:32:48 +00:00
|
|
|
// Module 6805 (LastMentionTimestampStore)
|
2026-10-01 14:13:23 +00:00
|
|
|
import get_initializedDefault from "get initialized" /* 504 */;
|
2026-10-07 22:43:51 +00:00
|
|
|
import DispatcherDefault from "Dispatcher" /* 584 */;
|
2026-10-12 16:32:48 +00:00
|
|
|
import GuildMemberStore from "GuildMemberStore" /* 2125 */;
|
|
|
|
|
import UserGuildSettingsStore from "UserGuildSettingsStore" /* 5966 */;
|
|
|
|
|
import UserStore from "UserStore" /* 1390 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
|
|
|
|
let timestamp = null;
|
2026-10-01 14:13:23 +00:00
|
|
|
const React4 = {};
|
|
|
|
|
const authStore = {};
|
|
|
|
|
const unpackModuleId = {};
|
2026-10-12 16:32:48 +00:00
|
|
|
const authStore2 = {};
|
2026-10-01 14:13:23 +00:00
|
|
|
const Store = get_initializedDefault.Store;
|
2026-09-18 19:45:33 +00:00
|
|
|
class LastMentionTimestampStore extends Store {
|
2026-10-01 14:13:23 +00:00
|
|
|
initialize() {
|
|
|
|
|
this.waitFor(GuildMemberStore, UserGuildSettingsStore, UserStore);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getGlobalStats() {
|
|
|
|
|
let rounded1;
|
|
|
|
|
let rounded2;
|
|
|
|
|
let rounded3;
|
|
|
|
|
let rounded = null;
|
|
|
|
|
if (null != timestamp) {
|
|
|
|
|
const _Math = Math;
|
|
|
|
|
const _Date = Date;
|
|
|
|
|
rounded = Math.floor((Date.now() - tmp) / 1000);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = { approx_seconds_since_last_notification: rounded, approx_seconds_since_last_mention: rounded1, approx_seconds_since_last_role_mention: rounded2, approx_seconds_since_last_everyone_mention: rounded3 };
|
|
|
|
|
rounded1 = null;
|
|
|
|
|
if (null != timestamp) {
|
|
|
|
|
const _Math2 = Math;
|
|
|
|
|
const _Date2 = Date;
|
|
|
|
|
rounded1 = Math.floor((Date.now() - tmp4) / 1000);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
rounded2 = null;
|
|
|
|
|
if (null != timestamp) {
|
|
|
|
|
const _Math3 = Math;
|
|
|
|
|
const _Date3 = Date;
|
|
|
|
|
rounded2 = Math.floor((Date.now() - tmp7) / 1000);
|
|
|
|
|
}
|
|
|
|
|
rounded3 = null;
|
|
|
|
|
if (null != timestamp) {
|
|
|
|
|
const _Math4 = Math;
|
|
|
|
|
const _Date4 = Date;
|
|
|
|
|
rounded3 = Math.floor((Date.now() - tmp10) / 1000);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
return obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getStats(arg0) {
|
|
|
|
|
let rounded1;
|
|
|
|
|
let rounded2;
|
|
|
|
|
let rounded3;
|
|
|
|
|
let tmp13;
|
|
|
|
|
let tmp18;
|
|
|
|
|
let tmp23;
|
|
|
|
|
let tmp28;
|
|
|
|
|
let rounded = null;
|
|
|
|
|
if (null != timestamp) {
|
|
|
|
|
const _Math = Math;
|
|
|
|
|
const _Date = Date;
|
|
|
|
|
rounded = Math.floor((Date.now() - tmp) / 1000);
|
|
|
|
|
}
|
|
|
|
|
const obj = { approx_seconds_since_last_notification: rounded, approx_seconds_since_last_mention: rounded1, approx_seconds_since_last_role_mention: rounded2, approx_seconds_since_last_everyone_mention: rounded3, approx_seconds_since_last_guild_notification: tmp13, approx_seconds_since_last_guild_mention: tmp18, approx_seconds_since_last_guild_role_mention: tmp23, approx_seconds_since_last_guild_everyone_mention: tmp28 };
|
|
|
|
|
rounded1 = null;
|
|
|
|
|
if (null != timestamp) {
|
|
|
|
|
const _Math2 = Math;
|
|
|
|
|
const _Date2 = Date;
|
|
|
|
|
rounded1 = Math.floor((Date.now() - tmp4) / 1000);
|
|
|
|
|
}
|
|
|
|
|
rounded2 = null;
|
|
|
|
|
if (null != timestamp) {
|
|
|
|
|
const _Math3 = Math;
|
|
|
|
|
const _Date3 = Date;
|
|
|
|
|
rounded2 = Math.floor((Date.now() - tmp7) / 1000);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
rounded3 = null;
|
|
|
|
|
if (null != timestamp) {
|
|
|
|
|
const _Math4 = Math;
|
|
|
|
|
const _Date4 = Date;
|
|
|
|
|
rounded3 = Math.floor((Date.now() - tmp10) / 1000);
|
|
|
|
|
}
|
|
|
|
|
tmp13 = null;
|
|
|
|
|
if (null != arg0) {
|
|
|
|
|
let rounded4 = null;
|
|
|
|
|
if (null != closure_9[arg0]) {
|
|
|
|
|
const _Math5 = Math;
|
|
|
|
|
const _Date5 = Date;
|
|
|
|
|
rounded4 = Math.floor((Date.now() - tmp15) / 1000);
|
|
|
|
|
}
|
|
|
|
|
tmp13 = rounded4;
|
|
|
|
|
}
|
|
|
|
|
tmp18 = null;
|
|
|
|
|
if (null != arg0) {
|
|
|
|
|
let rounded5 = null;
|
|
|
|
|
if (null != closure_10[arg0]) {
|
|
|
|
|
const _Math6 = Math;
|
|
|
|
|
const _Date6 = Date;
|
|
|
|
|
rounded5 = Math.floor((Date.now() - tmp20) / 1000);
|
|
|
|
|
}
|
|
|
|
|
tmp18 = rounded5;
|
|
|
|
|
}
|
|
|
|
|
tmp23 = null;
|
|
|
|
|
if (null != arg0) {
|
|
|
|
|
let rounded6 = null;
|
|
|
|
|
if (null != closure_12[arg0]) {
|
|
|
|
|
const _Math7 = Math;
|
|
|
|
|
const _Date7 = Date;
|
|
|
|
|
rounded6 = Math.floor((Date.now() - tmp25) / 1000);
|
|
|
|
|
}
|
|
|
|
|
tmp23 = rounded6;
|
|
|
|
|
}
|
|
|
|
|
tmp28 = null;
|
|
|
|
|
if (null != arg0) {
|
|
|
|
|
let rounded7 = null;
|
|
|
|
|
if (null != closure_11[arg0]) {
|
|
|
|
|
const _Math8 = Math;
|
|
|
|
|
const _Date8 = Date;
|
|
|
|
|
rounded7 = Math.floor((Date.now() - tmp30) / 1000);
|
|
|
|
|
}
|
|
|
|
|
tmp28 = rounded7;
|
|
|
|
|
}
|
|
|
|
|
return obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
}
|
|
|
|
|
const prototype = LastMentionTimestampStore.prototype;
|
|
|
|
|
let obj = {
|
2026-09-18 19:45:33 +00:00
|
|
|
CONNECTION_OPEN: function handleConnectionOpen() {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp2 = null != timestamp;
|
|
|
|
|
if (tmp2) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const _Date = Date;
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp2 = Date.now() - tmp < 60000;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (!tmp2) {
|
2026-09-18 19:45:33 +00:00
|
|
|
timestamp = null;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp5 = null != timestamp;
|
|
|
|
|
if (tmp5) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const _Date2 = Date;
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp5 = Date.now() - tmp4 < 60000;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (!tmp5) {
|
2026-09-18 19:45:33 +00:00
|
|
|
timestamp = null;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp8 = null != timestamp;
|
|
|
|
|
if (tmp8) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const _Date3 = Date;
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp8 = Date.now() - tmp7 < 60000;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (!tmp8) {
|
2026-09-18 19:45:33 +00:00
|
|
|
timestamp = null;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp11 = null != timestamp;
|
|
|
|
|
if (tmp11) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const _Date4 = Date;
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp11 = Date.now() - tmp10 < 60000;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (!tmp11) {
|
2026-09-18 19:45:33 +00:00
|
|
|
timestamp = null;
|
|
|
|
|
}
|
|
|
|
|
for (const key10037 in closure_9) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp19 = closure_9[key10037];
|
|
|
|
|
let tmp13 = null != tmp19;
|
|
|
|
|
let tmp17 = key10037;
|
|
|
|
|
let tmp18 = closure_9;
|
|
|
|
|
if (tmp13) {
|
2026-09-18 19:45:33 +00:00
|
|
|
let _Date5 = Date;
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp13 = Date.now() - tmp19 < 60000;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp13) {
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
delete tmp18[tmp17];
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
for (const key10045 in closure_10) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp22 = closure_10[key10045];
|
|
|
|
|
let tmp14 = null != tmp22;
|
|
|
|
|
let tmp20 = key10045;
|
|
|
|
|
let tmp21 = closure_10;
|
|
|
|
|
if (tmp14) {
|
2026-09-18 19:45:33 +00:00
|
|
|
let _Date6 = Date;
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp14 = Date.now() - tmp22 < 60000;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp14) {
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
delete tmp21[tmp20];
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
for (const key10053 in closure_12) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp25 = closure_12[key10053];
|
|
|
|
|
let tmp15 = null != tmp25;
|
|
|
|
|
let tmp23 = key10053;
|
|
|
|
|
let tmp24 = closure_12;
|
|
|
|
|
if (tmp15) {
|
2026-09-18 19:45:33 +00:00
|
|
|
let _Date7 = Date;
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp15 = Date.now() - tmp25 < 60000;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp15) {
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
delete tmp24[tmp23];
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
for (const key10061 in closure_11) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp28 = closure_11[key10061];
|
|
|
|
|
let tmp16 = null != tmp28;
|
|
|
|
|
let tmp26 = key10061;
|
|
|
|
|
let tmp27 = closure_11;
|
|
|
|
|
if (tmp16) {
|
2026-09-18 19:45:33 +00:00
|
|
|
let _Date8 = Date;
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp16 = Date.now() - tmp28 < 60000;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp16) {
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
delete tmp27[tmp26];
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
MESSAGE_NOTIFICATION_SHOWN: function handleMessageNotificationShown(guildId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let everyoneMentioned;
|
|
|
|
|
let mentioned;
|
|
|
|
|
let roleMentioned;
|
2026-09-18 19:45:33 +00:00
|
|
|
guildId = guildId.guildId;
|
|
|
|
|
({ mentioned, roleMentioned, everyoneMentioned } = guildId);
|
|
|
|
|
timestamp = Date.now();
|
|
|
|
|
if (null != guildId) {
|
|
|
|
|
closure_9[guildId] = timestamp;
|
|
|
|
|
}
|
|
|
|
|
if (mentioned) {
|
|
|
|
|
if (null != guildId) {
|
|
|
|
|
closure_10[guildId] = timestamp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (roleMentioned) {
|
|
|
|
|
if (null != guildId) {
|
|
|
|
|
closure_12[guildId] = timestamp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (everyoneMentioned) {
|
|
|
|
|
if (null != guildId) {
|
|
|
|
|
closure_11[guildId] = timestamp;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
};
|
|
|
|
|
const lastMentionTimestampStore = new LastMentionTimestampStore(DispatcherDefault, obj);
|
2026-09-18 19:45:33 +00:00
|
|
|
let result = size.fileFinishedImporting("modules/notifications/LastMentionTimestampStore.tsx");
|
|
|
|
|
|
|
|
|
|
export default lastMentionTimestampStore;
|
|
|
|
|
export const trackMessageNotificationTimestamps = function trackMessageNotificationTimestamps(mentions, guildId) {
|
|
|
|
|
const currentUser = UserStore.getCurrentUser();
|
|
|
|
|
let id;
|
|
|
|
|
if (currentUser != null) {
|
|
|
|
|
id = currentUser.id;
|
|
|
|
|
}
|
|
|
|
|
const result = UserGuildSettingsStore.isSuppressEveryoneEnabled(guildId);
|
|
|
|
|
let someResult = null != mentions.mentions;
|
|
|
|
|
const result1 = UserGuildSettingsStore.isSuppressRolesEnabled(guildId);
|
|
|
|
|
if (someResult) {
|
|
|
|
|
mentions = mentions.mentions;
|
|
|
|
|
someResult = mentions.some((id) => id.id === id);
|
|
|
|
|
}
|
|
|
|
|
let member = null;
|
|
|
|
|
if (null != guildId) {
|
|
|
|
|
member = null;
|
|
|
|
|
if (null != id) {
|
|
|
|
|
member = GuildMemberStore.getMember(guildId, id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let someResult1 = null != mentions.mention_roles && null != member && null != member.roles;
|
|
|
|
|
if (someResult1) {
|
|
|
|
|
const mention_roles = mentions.mention_roles;
|
|
|
|
|
someResult1 = mention_roles.some((item) => {
|
|
|
|
|
const roles = member.roles;
|
|
|
|
|
return roles.includes(item);
|
|
|
|
|
});
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = { type: "MESSAGE_NOTIFICATION_SHOWN", guildId, mentioned: someResult, roleMentioned: someResult1, everyoneMentioned: true === mentions.mention_everyone && !result };
|
|
|
|
|
const dispatch = DispatcherDefault.dispatch;
|
|
|
|
|
DispatcherDefault;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (someResult1) {
|
|
|
|
|
someResult1 = !result1;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
dispatch(obj);
|
2026-09-18 19:45:33 +00:00
|
|
|
};
|