decord/source/modules/inbox/RecentMentionsStore.tsx

647 lines
22 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 5389
// Function ID: 5390
2026-07-29 08:29:29 +00:00
// Name: findOrCreateMessageRecord
2026-08-24 06:08:38 +00:00
// Dependencies: [4034, 1218, 1391, 4999, 4777, 4033, 4201, 5048, 1922, 676, 595, 4808, 5257, 4824, 12, 4553, 5390, 5391, 589, 709, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 5389 (findOrCreateMessageRecord)
import applyDefault from "apply" /* 12 */;
import initializeDefault from "initialize" /* 589 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import sleep from "sleep" /* 4553 */;
import createMinimalMessageRecord from "createMinimalMessageRecord" /* 4808 */;
import isMentioned from "isMentioned" /* 4824 */;
import isMentionedDefault from "isMentioned" /* 4824 */;
import shouldShowAgeGateForVoiceChannel from "shouldShowAgeGateForVoiceChannel" /* 5257 */;
import isSystemMessageDefault from "isSystemMessage" /* 5390 */;
import closure_3 from "hasFlag" /* 4034 */;
import closure_4 from "fetchFingerprint" /* 1218 */;
import closure_5 from "ensureGuildLoaded" /* 1391 */;
import closure_6 from "reinjectEphemerals" /* 4999 */;
import closure_7 from "generateOldThreadCutoff" /* 4777 */;
import closure_8 from "markAllUserIdListsStale" /* 4033 */;
import closure_9 from "handleConnectionOpen" /* 4201 */;
import closure_10 from "updateUserGuildSettingsInternal" /* 5048 */;
import closure_11 from "mergeGuildAvatar" /* 1922 */;
import ME from "ME" /* 676 */;
import { Storage } from "Storage" /* 595 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function findOrCreateMessageRecord(channel_id) {
2026-08-24 06:08:38 +00:00
if (channel_id instanceof closure_3) {
2026-07-20 16:05:17 +00:00
return channel_id;
} else {
2026-07-29 08:29:29 +00:00
let message = store2.getMessage(channel_id.channel_id, channel_id.id);
2026-07-20 16:05:17 +00:00
if (null == message) {
2026-08-24 06:08:38 +00:00
message = createMinimalMessageRecord.createMessageRecord(channel_id);
const obj = createMinimalMessageRecord;
2026-07-20 16:05:17 +00:00
}
return message;
}
}
function hasMentionNotificationEnabled(channel_id) {
const basicChannel = store.getBasicChannel(channel_id.channel_id);
if (null != basicChannel) {
const GUILD_TEXTUAL = constants4.GUILD_TEXTUAL;
if (GUILD_TEXTUAL.has(basicChannel.type)) {
2026-08-24 06:08:38 +00:00
let obj = closure_10;
if (closure_10.isGuildOrCategoryOrChannelMuted(basicChannel.guild_id, basicChannel.id)) {
2026-07-20 16:05:17 +00:00
return false;
} else {
2026-07-29 08:29:29 +00:00
if (obj2.shouldShowAgeGateForChannelId(basicChannel.id)) {
2026-07-20 16:05:17 +00:00
return false;
} else {
2026-07-29 08:29:29 +00:00
const result = obj.resolvedMessageNotifications(basicChannel);
2026-07-20 16:05:17 +00:00
if (constants3.ALL_MESSAGES === result) {
return true;
2026-07-29 08:29:29 +00:00
} else if (tmp5.ONLY_MENTIONS === result) {
const result1 = obj.isSuppressEveryoneEnabled(basicChannel.guild_id);
const result2 = obj.isSuppressRolesEnabled(basicChannel.guild_id);
2026-07-20 16:05:17 +00:00
const currentUser = authStore.getCurrentUser();
2026-07-29 08:29:29 +00:00
let tmp10 = null != currentUser;
if (tmp10) {
obj = { message: null, userId: null, suppressEveryone: null, suppressRoles: null };
obj[0] = channel_id;
obj[1] = currentUser.id;
obj[2] = result1;
obj[3] = result2;
2026-08-24 06:08:38 +00:00
tmp10 = isMentionedDefault(obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp10;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const NO_MESSAGES = tmp5.NO_MESSAGES;
2026-07-20 16:05:17 +00:00
return false;
}
}
2026-08-24 06:08:38 +00:00
obj2 = shouldShowAgeGateForVoiceChannel;
2026-07-20 16:05:17 +00:00
}
}
}
return false;
}
function parseMessage(message, channelId) {
let channel_id = channelId;
if (channelId === undefined) {
channel_id = null;
}
2026-08-24 06:08:38 +00:00
if (isSystemMessageDefault(message)) {
2026-07-20 16:05:17 +00:00
const SELF_MENTIONABLE_SYSTEM = constants2.SELF_MENTIONABLE_SYSTEM;
if (!SELF_MENTIONABLE_SYSTEM.has(message.type)) {
return null;
}
}
if (null == channel_id) {
channel_id = message.channel_id;
}
const channel = store.getChannel(channel_id);
if (null != channel) {
if (channel.type !== constants.DM) {
2026-07-29 08:29:29 +00:00
if (closure_23.guildFilter === RecentMentionsFilters.THIS_SERVER) {
2026-07-20 16:05:17 +00:00
const guildId = channel.getGuildId();
if (guildId !== guildId.getGuildId()) {
return null;
}
}
2026-07-23 10:11:24 +00:00
id = id.getId();
2026-07-20 16:05:17 +00:00
if (!blockedOrIgnoredForMessage.isBlockedOrIgnoredForMessage(message)) {
2026-08-24 06:08:38 +00:00
if (!tmp2(5391)(message, id)) {
2026-07-29 08:29:29 +00:00
let tmp12 = message;
2026-08-24 06:08:38 +00:00
if (!(message instanceof closure_3)) {
2026-07-29 08:29:29 +00:00
message = store2.getMessage(message.channel_id, message.id);
if (null == message) {
2026-08-24 06:08:38 +00:00
message = createMinimalMessageRecord.createMessageRecord(message);
const obj2 = createMinimalMessageRecord;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp12 = message;
}
let obj = { message: null, userId: null, suppressEveryone: null, suppressRoles: null };
obj[0] = tmp12;
obj[1] = id;
obj[2] = !closure_23.everyoneFilter;
obj[3] = !closure_23.roleFilter;
let tmp20 = null;
2026-08-24 06:08:38 +00:00
if (tmp2(4824)(obj)) {
2026-07-29 08:29:29 +00:00
let tmp2ResultResult = c26;
if (c26) {
2026-08-24 06:08:38 +00:00
tmp2ResultResult = closure_7.ackMessageId(channel.id) !== tmp12.id;
2026-07-29 08:29:29 +00:00
}
if (tmp2ResultResult) {
obj = { message: null, userId: null, suppressEveryone: null, suppressRoles: null };
obj[0] = tmp12;
obj[1] = id;
2026-08-24 06:08:38 +00:00
obj[2] = closure_10.isSuppressEveryoneEnabled(channel.getGuildId());
obj[3] = closure_10.isSuppressRolesEnabled(channel.getGuildId());
tmp2ResultResult = tmp2(4824)(obj);
const tmp2Result = tmp2(4824);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp20 = tmp12;
if (tmp2ResultResult) {
c26 = false;
tmp20 = tmp12;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return tmp20;
2026-07-20 16:05:17 +00:00
}
}
return null;
}
}
return null;
}
function deleteMessage(arg0) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-23 10:11:24 +00:00
if (null == dependencyMap[arg0]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-29 08:29:29 +00:00
const obj = { deletedMessages: null };
2026-08-24 06:08:38 +00:00
obj[0] = applyDefault.filter(closure_18, (id) => id.id === id);
2026-07-29 08:29:29 +00:00
({ addedMessages, deletedMessages } = obj);
if (null != addedMessages) {
const item = addedMessages.forEach((getChannelId) => {
if (null == dependencyMap[getChannelId.getChannelId(getChannelId)]) {
dependencyMap[getChannelId.getChannelId()] = 0;
}
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = dependencyMap[channelId] + 1;
});
}
if (null != deletedMessages) {
const item1 = deletedMessages.forEach((getChannelId) => {
if (null != dependencyMap[getChannelId.getChannelId(getChannelId)]) {
const _Math = Math;
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = Math.max(0, dependencyMap[getChannelId.getChannelId(getChannelId)] - 1);
}
});
}
2026-08-24 06:08:38 +00:00
const arr2 = applyDefault;
2026-07-29 08:29:29 +00:00
const tmp7 = importDefault;
2026-08-24 06:08:38 +00:00
closure_18 = applyDefault.filter(closure_18, (id) => id.id !== id);
2026-07-20 16:05:17 +00:00
}
}
function handleMessageDelete(id) {
2026-07-29 08:29:29 +00:00
id = id.id;
if (null != dependencyMap[id]) {
delete tmp[tmp2];
const obj = { deletedMessages: null };
2026-08-24 06:08:38 +00:00
obj[0] = applyDefault.filter(closure_18, (id) => id.id === id);
2026-07-29 08:29:29 +00:00
({ addedMessages, deletedMessages } = obj);
if (null != addedMessages) {
const item = addedMessages.forEach((getChannelId) => {
if (null == dependencyMap[getChannelId.getChannelId(getChannelId)]) {
dependencyMap[getChannelId.getChannelId()] = 0;
}
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = dependencyMap[channelId] + 1;
});
}
if (null != deletedMessages) {
const item1 = deletedMessages.forEach((getChannelId) => {
if (null != dependencyMap[getChannelId.getChannelId(getChannelId)]) {
const _Math = Math;
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = Math.max(0, dependencyMap[getChannelId.getChannelId(getChannelId)] - 1);
}
});
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const arr = applyDefault;
2026-07-29 08:29:29 +00:00
const tmp4 = importDefault;
2026-08-24 06:08:38 +00:00
closure_18 = applyDefault.filter(closure_18, (id) => id.id !== id);
const tmp4Result = applyDefault;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return false;
}
function handleSetRecentMentionsFilters(arg0) {
2026-07-20 16:05:17 +00:00
const obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(closure_23);
2026-08-24 06:08:38 +00:00
const obj2 = applyDefault;
closure_23 = obj2.defaults(applyDefault.pick(arg0, ["guildFilter", "roleFilter", "everyoneFilter"]), closure_23);
2026-07-29 08:29:29 +00:00
const Storage = items(595).Storage;
const result = Storage.set(recentMentionFilterSettings, closure_23);
let tmp4 = obj.guildFilter !== closure_23.guildFilter;
if (tmp4) {
tmp4 = closure_23.guildFilter === tmp3;
}
if (!tmp4) {
let tmp7 = obj.everyoneFilter !== closure_23.everyoneFilter;
if (tmp7) {
tmp7 = closure_23.everyoneFilter === false;
}
tmp4 = tmp7;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp4) {
let tmp10 = obj.roleFilter !== closure_23.roleFilter;
if (tmp10) {
tmp10 = closure_23.roleFilter === false;
}
tmp4 = tmp10;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_20 = {};
2026-07-23 10:11:24 +00:00
items = [];
2026-07-29 08:29:29 +00:00
if (tmp4) {
const item = items.forEach((arg0) => {
2026-08-24 06:08:38 +00:00
const tmp = closure_1_29(arg0);
2026-07-20 16:05:17 +00:00
if (null != tmp) {
items.push(tmp);
2026-07-29 08:29:29 +00:00
closure_20[tmp.id] = true;
2026-07-20 16:05:17 +00:00
}
});
}
2026-08-24 06:08:38 +00:00
closure_19 = {};
2026-07-29 08:29:29 +00:00
const item1 = items.forEach((getChannelId) => {
if (null == dependencyMap[getChannelId.getChannelId(getChannelId)]) {
dependencyMap[getChannelId.getChannelId()] = 0;
}
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = dependencyMap[channelId] + 1;
});
2026-07-20 16:05:17 +00:00
if (0 === items.length) {
2026-08-24 06:08:38 +00:00
c24 = false;
2026-07-20 16:05:17 +00:00
}
}
function handleRelationshipUpdate() {
2026-08-24 06:08:38 +00:00
const obj = { deletedMessages: applyDefault.filter(closure_18, (message) => closure_8.isBlockedOrIgnoredForMessage(message)) };
2026-07-29 08:29:29 +00:00
({ addedMessages, deletedMessages } = obj);
if (null != addedMessages) {
const item = addedMessages.forEach((getChannelId) => {
if (null == dependencyMap[getChannelId.getChannelId(getChannelId)]) {
dependencyMap[getChannelId.getChannelId()] = 0;
}
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = dependencyMap[channelId] + 1;
});
}
if (null != deletedMessages) {
const item1 = deletedMessages.forEach((getChannelId) => {
if (null != dependencyMap[getChannelId.getChannelId(getChannelId)]) {
const _Math = Math;
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = Math.max(0, dependencyMap[getChannelId.getChannelId(getChannelId)] - 1);
}
});
}
2026-08-24 06:08:38 +00:00
closure_18 = closure_18.filter((message) => !closure_8.isBlockedOrIgnoredForMessage(message));
2026-07-20 16:05:17 +00:00
}
function handleDeleteChannel(channel) {
2026-07-23 10:11:24 +00:00
channel = channel.channel;
2026-07-20 16:05:17 +00:00
const items = [];
2026-07-29 08:29:29 +00:00
closure_18 = items(12).filter(closure_18, (channel_id) => {
2026-07-20 16:05:17 +00:00
let flag = channel_id.channel_id !== channel.id;
if (!flag) {
const id = channel_id.id;
2026-07-23 10:11:24 +00:00
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
items.push(channel_id);
flag = false;
}
return flag;
});
2026-07-29 08:29:29 +00:00
({ addedMessages, deletedMessages } = { deletedMessages: items });
if (null != addedMessages) {
const item = addedMessages.forEach((getChannelId) => {
if (null == dependencyMap[getChannelId.getChannelId(getChannelId)]) {
dependencyMap[getChannelId.getChannelId()] = 0;
}
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = dependencyMap[channelId] + 1;
});
}
if (null != deletedMessages) {
const item1 = deletedMessages.forEach((getChannelId) => {
if (null != dependencyMap[getChannelId.getChannelId(getChannelId)]) {
const _Math = Math;
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = Math.max(0, dependencyMap[getChannelId.getChannelId(getChannelId)] - 1);
}
});
}
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const RecentMentionsFilters = ME.RecentMentionsFilters;
2026-07-29 08:29:29 +00:00
({ ChannelTypes: map1, MessageTypesSets: closure_14, UserNotificationSettings: closure_15, ChannelTypesSets: closure_16 } = ME);
2026-07-23 10:11:24 +00:00
const recentMentionFilterSettings = "recentMentionFilterSettings";
2026-07-29 08:29:29 +00:00
let closure_18 = [];
let closure_19 = {};
let closure_20 = {};
let c21 = false;
let c22 = true;
2026-07-23 10:11:24 +00:00
let obj = { guildFilter: RecentMentionsFilters.ALL_SERVERS, everyoneFilter: true, roleFilter: true };
2026-07-29 08:29:29 +00:00
let closure_23 = Storage.get("recentMentionFilterSettings", obj);
let c24 = false;
let c25 = 0;
let c26 = false;
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class RecentMentionsStore extends Store {
}
const prototype = RecentMentionsStore.prototype;
prototype["initialize"] = function initialize() {
2026-08-24 06:08:38 +00:00
this.waitFor(closure_4, closure_5, closure_6, closure_7, closure_8, closure_9, closure_10, closure_11);
2026-07-29 08:29:29 +00:00
};
Object.defineProperty(prototype, "hasLoadedEver", {
get: function hasLoadedEver() {
return c24;
},
set: undefined
});
Object.defineProperty(prototype, "lastLoaded", {
get: function lastLoaded() {
return c25;
},
set: undefined
});
prototype["getMentions"] = function getMentions() {
if (c24) {
let tmp2 = closure_18;
} else {
tmp2 = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp2;
};
prototype["getSettingsFilteredMentions"] = function getSettingsFilteredMentions() {
if (c24) {
let found = closure_18.filter(hasMentionNotificationEnabled);
} else {
found = null;
}
return found;
};
prototype["hasMention"] = function hasMention(arg0) {
return dependencyMap[arg0];
};
Object.defineProperty(prototype, "loading", {
get: function loading() {
return c21;
},
set: undefined
});
Object.defineProperty(prototype, "hasMore", {
get: function hasMore() {
return c22;
},
set: undefined
});
Object.defineProperty(prototype, "guildFilter", {
get: function guildFilter() {
return closure_23.guildFilter;
},
set: undefined
});
Object.defineProperty(prototype, "everyoneFilter", {
get: function everyoneFilter(arg0) {
return closure_23.everyoneFilter;
},
set: undefined
});
Object.defineProperty(prototype, "roleFilter", {
get: function roleFilter(arg0) {
return closure_23.roleFilter;
},
set: undefined
});
Object.defineProperty(prototype, "mentionsAreStale", {
get: function mentionsAreStale() {
return c26;
},
set: undefined
});
Object.defineProperty(prototype, "mentionCountByChannel", {
get: function mentionCountByChannel() {
return closure_19;
},
set: undefined
});
prototype["getMentionCountForChannel"] = function getMentionCountForChannel(arg0) {
let num = table[arg0];
if (num == null) {
num = 0;
}
return num;
};
RecentMentionsStore.displayName = "RecentMentionsStore";
2026-07-20 16:05:17 +00:00
obj = {
LOAD_RECENT_MENTIONS: function handleLoadMentions(guildId) {
2026-08-24 06:08:38 +00:00
c21 = true;
2026-07-20 16:05:17 +00:00
let tmp = null == guildId.guildId;
if (tmp) {
2026-07-29 08:29:29 +00:00
tmp = closure_23.guildFilter === RecentMentionsFilters.THIS_SERVER;
2026-07-20 16:05:17 +00:00
}
if (tmp) {
2026-07-29 08:29:29 +00:00
const obj = { guildFilter: null };
obj[0] = RecentMentionsFilters.ALL_SERVERS;
2026-07-20 16:05:17 +00:00
handleSetRecentMentionsFilters(obj);
}
},
LOAD_RECENT_MENTIONS_SUCCESS: function handleLoadMentionsSuccess(arg0) {
({ hasMoreAfter, messages, isAfter } = arg0);
2026-08-24 06:08:38 +00:00
let mapped = applyDefault.map(messages, findOrCreateMessageRecord);
2026-07-29 08:29:29 +00:00
({ addedMessages, deletedMessages } = { addedMessages: mapped });
if (null != addedMessages) {
const item = addedMessages.forEach((getChannelId) => {
if (null == dependencyMap[getChannelId.getChannelId(getChannelId)]) {
dependencyMap[getChannelId.getChannelId()] = 0;
}
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = dependencyMap[channelId] + 1;
});
}
if (null != deletedMessages) {
const item1 = deletedMessages.forEach((getChannelId) => {
if (null != dependencyMap[getChannelId.getChannelId(getChannelId)]) {
const _Math = Math;
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = Math.max(0, dependencyMap[getChannelId.getChannelId(getChannelId)] - 1);
}
});
}
2026-07-20 16:05:17 +00:00
if (isAfter) {
2026-07-23 10:11:24 +00:00
mapped = mapped.concat(mapped);
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
closure_20 = {};
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const arr = applyDefault;
2026-07-29 08:29:29 +00:00
const tmp = importDefault;
2026-08-24 06:08:38 +00:00
const item2 = applyDefault.forEach(mapped, (id) => {
2026-07-29 08:29:29 +00:00
closure_20[id.id] = true;
2026-07-20 16:05:17 +00:00
});
2026-08-24 06:08:38 +00:00
c21 = false;
const tmpResult = applyDefault;
closure_25 = sleep.now();
c24 = true;
2026-07-20 16:05:17 +00:00
},
LOAD_RECENT_MENTIONS_FAILURE: function handleLoadMentionsFailure() {
2026-08-24 06:08:38 +00:00
c21 = false;
2026-07-20 16:05:17 +00:00
},
SET_RECENT_MENTIONS_FILTER: handleSetRecentMentionsFilters,
CLEAR_MENTIONS: function handleClearMentions() {
2026-08-24 06:08:38 +00:00
closure_18 = [];
closure_20 = {};
c24 = false;
c26 = false;
closure_19 = {};
2026-07-20 16:05:17 +00:00
},
TRUNCATE_MENTIONS: function handleTruncateMentions(size) {
let length;
size = size.size;
2026-07-29 08:29:29 +00:00
({ addedMessages, deletedMessages } = { deletedMessages: substr.slice(size) });
if (null != addedMessages) {
const item = addedMessages.forEach((getChannelId) => {
if (null == dependencyMap[getChannelId.getChannelId(getChannelId)]) {
dependencyMap[getChannelId.getChannelId()] = 0;
}
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = dependencyMap[channelId] + 1;
});
}
if (null != deletedMessages) {
const item1 = deletedMessages.forEach((getChannelId) => {
if (null != dependencyMap[getChannelId.getChannelId(getChannelId)]) {
const _Math = Math;
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = Math.max(0, dependencyMap[getChannelId.getChannelId(getChannelId)] - 1);
}
});
}
2026-07-20 16:05:17 +00:00
let sum = size;
2026-07-23 10:11:24 +00:00
if (size < substr.length) {
2026-07-20 16:05:17 +00:00
do {
2026-07-29 08:29:29 +00:00
let tmp6 = closure_20;
let tmp7 = substr;
2026-07-23 10:11:24 +00:00
let id = substr[sum].id;
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
sum = sum + 1;
2026-07-29 08:29:29 +00:00
let tmp8 = substr;
2026-07-23 10:11:24 +00:00
length = substr.length;
2026-07-20 16:05:17 +00:00
} while (sum < length);
}
2026-07-23 10:11:24 +00:00
substr = substr.slice(0, size);
2026-07-20 16:05:17 +00:00
if (substr.length > substr.length) {
2026-08-24 06:08:38 +00:00
c22 = true;
2026-07-20 16:05:17 +00:00
}
},
CHANNEL_SELECT: function handleChannelSelect() {
2026-07-29 08:29:29 +00:00
if (closure_23.guildFilter !== RecentMentionsFilters.THIS_SERVER) {
2026-07-20 16:05:17 +00:00
return false;
} else {
2026-08-24 06:08:38 +00:00
c24 = false;
2026-07-20 16:05:17 +00:00
}
},
2026-07-29 08:29:29 +00:00
CONNECTION_OPEN: function handleConnectionOpen() {
2026-08-24 06:08:38 +00:00
closure_18 = [];
closure_20 = {};
c24 = false;
c26 = false;
closure_19 = {};
2026-07-29 08:29:29 +00:00
},
2026-07-20 16:05:17 +00:00
GUILD_DELETE: function handleGuildDelete(guild) {
2026-07-23 10:11:24 +00:00
guild = guild.guild;
2026-07-20 16:05:17 +00:00
const items = [];
2026-07-29 08:29:29 +00:00
closure_18 = items(12).filter(closure_18, (channel_id) => {
2026-08-24 06:08:38 +00:00
const channel = closure_1_5.getChannel(channel_id.channel_id);
2026-07-20 16:05:17 +00:00
let flag = null != channel;
if (flag) {
flag = channel.getGuildId() !== guild.id;
}
if (!flag) {
const id = channel_id.id;
2026-07-23 10:11:24 +00:00
delete tmp2[tmp];
2026-07-20 16:05:17 +00:00
items.push(channel_id);
flag = false;
}
return flag;
});
2026-07-29 08:29:29 +00:00
({ addedMessages, deletedMessages } = { deletedMessages: items });
if (null != addedMessages) {
const item = addedMessages.forEach((getChannelId) => {
if (null == dependencyMap[getChannelId.getChannelId(getChannelId)]) {
dependencyMap[getChannelId.getChannelId()] = 0;
}
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = dependencyMap[channelId] + 1;
});
}
if (null != deletedMessages) {
const item1 = deletedMessages.forEach((getChannelId) => {
if (null != dependencyMap[getChannelId.getChannelId(getChannelId)]) {
const _Math = Math;
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = Math.max(0, dependencyMap[getChannelId.getChannelId(getChannelId)] - 1);
}
});
}
2026-07-20 16:05:17 +00:00
},
MESSAGE_CREATE: function handleIncomingMessage(message) {
message = message.message;
const currentUser = authStore.getCurrentUser();
if (null != currentUser) {
2026-08-24 06:08:38 +00:00
let obj = { rawMessage: null, userId: null, suppressRoles: false, suppressEveryone: false };
2026-07-29 08:29:29 +00:00
obj[0] = message;
obj[1] = currentUser.id;
2026-08-24 06:08:38 +00:00
if (obj2.isRawMessageMentioned(obj)) {
2026-07-20 16:05:17 +00:00
const tmp3 = parseMessage(message, message.channelId);
if (null == tmp3) {
return false;
} else {
2026-07-23 10:11:24 +00:00
substr = substr.slice();
substr.unshift(tmp3);
2026-07-29 08:29:29 +00:00
closure_20[tmp3.id] = true;
obj = { addedMessages: null };
2026-07-20 16:05:17 +00:00
const items = [tmp3];
2026-07-29 08:29:29 +00:00
obj[0] = items;
({ addedMessages, deletedMessages } = obj);
if (null != addedMessages) {
const item = addedMessages.forEach((getChannelId) => {
if (null == dependencyMap[getChannelId.getChannelId(getChannelId)]) {
dependencyMap[getChannelId.getChannelId()] = 0;
}
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = dependencyMap[channelId] + 1;
});
}
if (null != deletedMessages) {
const item1 = deletedMessages.forEach((getChannelId) => {
if (null != dependencyMap[getChannelId.getChannelId(getChannelId)]) {
const _Math = Math;
const channelId = getChannelId.getChannelId();
dependencyMap[channelId] = Math.max(0, dependencyMap[getChannelId.getChannelId(getChannelId)] - 1);
}
});
}
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
obj2 = isMentioned;
2026-07-20 16:05:17 +00:00
}
return false;
},
MESSAGE_UPDATE: function handleMessageUpdate(message) {
const id = message.message.id;
if (null != id) {
2026-07-23 10:11:24 +00:00
if (null != dependencyMap[id]) {
2026-08-24 06:08:38 +00:00
const findIndexResult = applyDefault.findIndex(substr, (id) => id.id === id);
2026-07-23 10:11:24 +00:00
substr = substr.slice();
2026-07-20 16:05:17 +00:00
if (null != substr[findIndexResult]) {
2026-08-24 06:08:38 +00:00
substr[findIndexResult] = id(4808).updateMessageRecord(tmp7, message.message);
const obj2 = id(4808);
2026-07-20 16:05:17 +00:00
}
}
}
return false;
},
MESSAGE_DELETE: handleMessageDelete,
RECENT_MENTION_DELETE: handleMessageDelete,
MESSAGE_DELETE_BULK: function handleMessageDeleteBulk(ids) {
2026-08-24 06:08:38 +00:00
const item = applyDefault.forEach(ids.ids, deleteMessage);
2026-07-20 16:05:17 +00:00
},
CHANNEL_DELETE: handleDeleteChannel,
THREAD_DELETE: handleDeleteChannel,
RELATIONSHIP_ADD: handleRelationshipUpdate,
RELATIONSHIP_REMOVE: handleRelationshipUpdate,
RELATIONSHIP_UPDATE: handleRelationshipUpdate,
SET_RECENT_MENTIONS_STALE: function handleSetRecentMentionsStale() {
2026-08-24 06:08:38 +00:00
c26 = true;
2026-07-20 16:05:17 +00:00
}
};
2026-08-24 06:08:38 +00:00
const recentMentionsStore = new RecentMentionsStore(dispatcherDefault, obj);
let result = require("set").fileFinishedImporting("modules/inbox/RecentMentionsStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default recentMentionsStore;
2026-07-20 16:05:17 +00:00
export { hasMentionNotificationEnabled };
export { parseMessage };