decord/source/modules/search/SearchRecentMessageStore.tsx

75 lines
2 KiB
TypeScript
Raw Normal View History

2026-08-13 17:34:28 +00:00
// Module ID: 11774
// Function ID: 11775
2026-07-29 08:29:29 +00:00
// Name: handleReset
2026-08-13 07:00:46 +00:00
// Dependencies: [4564, 589, 709, 2]
2026-07-20 16:05:17 +00:00
2026-08-13 17:34:28 +00:00
// Module 11774 (handleReset)
2026-07-29 08:29:29 +00:00
import { Store } from "initialize";
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function handleReset() {
const map = new Map();
}
2026-07-23 10:11:24 +00:00
let map = new Map();
2026-07-29 08:29:29 +00:00
let closure_3 = [];
class SearchRecentMessageStore extends Store {
}
SearchRecentMessageStore.prototype["getRecentMessageAuthorIds"] = function getRecentMessageAuthorIds(guildId) {
let value = map.get(guildId);
if (value == null) {
value = closure_3;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return value;
};
SearchRecentMessageStore.displayName = "SearchRecentMessageStore";
const searchRecentMessageStore = new SearchRecentMessageStore(require("dispatcher"), {
2026-07-20 16:05:17 +00:00
SEARCH_MESSAGES_SUCCESS: function handleSearchMessagesSuccess(arg0) {
let data;
let guildId;
({ guildId, data } = arg0);
2026-07-23 10:11:24 +00:00
let c0;
let items;
let set;
2026-07-20 16:05:17 +00:00
if (null == guildId) {
return false;
} else {
2026-07-23 10:11:24 +00:00
c0 = false;
2026-07-29 08:29:29 +00:00
items = set.get(guildId);
if (items == null) {
2026-07-20 16:05:17 +00:00
items = [];
}
items = [];
HermesBuiltin.arraySpread(items, 0);
const _Set = Set;
2026-07-23 10:11:24 +00:00
set = new Set(items);
let item = data.forEach((messages) => {
2026-07-20 16:05:17 +00:00
messages = messages.messages;
const item = messages.forEach((arg0) => {
let tmp;
[tmp] = arg0;
2026-07-29 08:29:29 +00:00
const messageRecord = outer1_0(outer1_1[0]).createMessageRecord(tmp);
const hasItem = set.has(messageRecord.author.id);
let tmp4 = !hasItem;
if (!hasItem) {
tmp4 = obj2.size < 15;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
obj2.add(messageRecord.author.id);
arr = arr.push(messageRecord.author.id);
let c0 = true;
2026-07-20 16:05:17 +00:00
}
});
});
2026-07-23 10:11:24 +00:00
if (c0) {
2026-07-29 08:29:29 +00:00
const result = set.set(guildId, items);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
return c0;
2026-07-20 16:05:17 +00:00
}
},
SEARCH_RECENT_MESSAGES_CLEAR: handleReset,
CONNECTION_OPEN: handleReset
});
2026-07-29 08:29:29 +00:00
let result = require("dispatcher").fileFinishedImporting("modules/search/SearchRecentMessageStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default searchRecentMessageStore;