2026-10-02 13:37:24 +00:00
|
|
|
// Module ID: 7193
|
|
|
|
|
// Function ID: 7194
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: ThreadMembersStore
|
2026-10-02 13:37:24 +00:00
|
|
|
// Dependencies: [2055, 2051, 12, 504, 585, 2]
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-10-02 13:37:24 +00:00
|
|
|
// Module 7193 (ThreadMembersStore)
|
2026-09-18 19:45:33 +00:00
|
|
|
import _modDef12 from "module_12" /* 12 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import get_initializedDefault from "get initialized" /* 504 */;
|
2026-10-02 13:37:24 +00:00
|
|
|
import DispatcherDefault from "Dispatcher" /* 585 */;
|
|
|
|
|
import ChannelRecord from "ChannelRecord" /* 2055 */;
|
|
|
|
|
import ChannelStore from "ChannelStore" /* 2051 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
|
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
let thread;
|
|
|
|
|
|
2026-09-18 19:45:33 +00:00
|
|
|
function updateFromGuild(threads) {
|
|
|
|
|
threads = threads.threads;
|
|
|
|
|
if (threads != null) {
|
|
|
|
|
const item = threads.forEach(updateFromThread);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function updateFromThread(type) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let memberCount;
|
|
|
|
|
let memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (ALL_CHANNEL_TYPES.has(type.type)) {
|
2026-10-01 14:13:23 +00:00
|
|
|
if (!(type.id in closure_4)) {
|
|
|
|
|
const obj = { guildId: null, parentId: null, memberCount, memberIdsPreview };
|
2026-09-18 19:45:33 +00:00
|
|
|
({ guild_id: obj.guildId, parent_id: obj.parentId, memberCount } = type);
|
2026-10-01 14:13:23 +00:00
|
|
|
const id = type.id;
|
|
|
|
|
const tmp2 = closure_4;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (memberCount == null) {
|
|
|
|
|
memberCount = 0;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
memberIdsPreview = type.memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (memberIdsPreview == null) {
|
|
|
|
|
memberIdsPreview = [];
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp2[id] = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (null != type.memberCount) {
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_4[type.id].memberCount = type.memberCount;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (null != type.memberIdsPreview) {
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_4[type.id].memberIdsPreview = type.memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function handleThreadCreateOrUpdate(channel) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let memberCount;
|
|
|
|
|
let memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
channel = channel.channel;
|
|
|
|
|
if (ALL_CHANNEL_TYPES.has(channel.type)) {
|
2026-10-01 14:13:23 +00:00
|
|
|
if (!(channel.id in closure_4)) {
|
|
|
|
|
const obj = { guildId: null, parentId: null, memberCount, memberIdsPreview };
|
2026-09-18 19:45:33 +00:00
|
|
|
({ guild_id: obj.guildId, parent_id: obj.parentId, memberCount } = channel);
|
2026-10-01 14:13:23 +00:00
|
|
|
const id = channel.id;
|
|
|
|
|
const tmp2 = closure_4;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (memberCount == null) {
|
|
|
|
|
memberCount = 0;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
memberIdsPreview = channel.memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (memberIdsPreview == null) {
|
|
|
|
|
memberIdsPreview = [];
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp2[id] = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (null != channel.memberCount) {
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_4[channel.id].memberCount = channel.memberCount;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (null != channel.memberIdsPreview) {
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_4[channel.id].memberIdsPreview = channel.memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
function handleLoadArchivedThreadsSuccess(threads) {
|
|
|
|
|
threads = threads.threads;
|
|
|
|
|
const item = threads.forEach(updateFromServerThread);
|
|
|
|
|
}
|
|
|
|
|
function handleSearchMessagesSuccess(data) {
|
|
|
|
|
data = data.data;
|
2026-10-01 14:13:23 +00:00
|
|
|
let c0 = false;
|
2026-09-18 19:45:33 +00:00
|
|
|
let item = data.forEach((item) => {
|
2026-10-01 14:13:23 +00:00
|
|
|
let flag;
|
|
|
|
|
let messages;
|
|
|
|
|
let threads;
|
2026-09-18 19:45:33 +00:00
|
|
|
({ threads, messages } = item);
|
|
|
|
|
item = messages.forEach((arr) => {
|
|
|
|
|
const item = arr.forEach((thread) => {
|
2026-10-01 14:13:23 +00:00
|
|
|
let memberCount;
|
|
|
|
|
let memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
thread = thread.thread;
|
|
|
|
|
if (null != thread) {
|
|
|
|
|
if (!(thread.id in closure_2_4)) {
|
|
|
|
|
channel = channel.getChannel(thread.id);
|
|
|
|
|
if (null != channel) {
|
|
|
|
|
if (set.has(channel.type)) {
|
|
|
|
|
if (!(channel.id in closure_2_4)) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = { guildId: null, parentId: null, memberCount, memberIdsPreview };
|
2026-09-18 19:45:33 +00:00
|
|
|
({ guild_id: obj.guildId, parent_id: obj.parentId, memberCount } = channel);
|
2026-10-01 14:13:23 +00:00
|
|
|
const id = channel.id;
|
|
|
|
|
const tmp6 = closure_2_4;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (memberCount == null) {
|
|
|
|
|
memberCount = 0;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
memberIdsPreview = channel.memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (memberIdsPreview == null) {
|
|
|
|
|
memberIdsPreview = [];
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp6[id] = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (null != channel.memberCount) {
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_2_4[channel.id].memberCount = channel.memberCount;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (null != channel.memberIdsPreview) {
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_2_4[channel.id].memberIdsPreview = channel.memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
const item1 = threads.forEach((id) => {
|
2026-10-01 14:13:23 +00:00
|
|
|
let memberCount;
|
|
|
|
|
let memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != id) {
|
2026-10-01 14:13:23 +00:00
|
|
|
if (!(id.id in closure_2_4)) {
|
2026-09-18 19:45:33 +00:00
|
|
|
channel = channel.getChannel(id.id);
|
|
|
|
|
if (null != channel) {
|
|
|
|
|
if (set.has(channel.type)) {
|
2026-10-01 14:13:23 +00:00
|
|
|
if (!(channel.id in closure_2_4)) {
|
|
|
|
|
const obj = { guildId: null, parentId: null, memberCount, memberIdsPreview };
|
2026-09-18 19:45:33 +00:00
|
|
|
({ guild_id: obj.guildId, parent_id: obj.parentId, memberCount } = channel);
|
2026-10-01 14:13:23 +00:00
|
|
|
id = channel.id;
|
|
|
|
|
const tmp6 = closure_2_4;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (memberCount == null) {
|
|
|
|
|
memberCount = 0;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
memberIdsPreview = channel.memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (memberIdsPreview == null) {
|
|
|
|
|
memberIdsPreview = [];
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp6[id] = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (null != channel.memberCount) {
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_2_4[channel.id].memberCount = channel.memberCount;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (null != channel.memberIdsPreview) {
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_2_4[channel.id].memberIdsPreview = channel.memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
return c0;
|
|
|
|
|
}
|
|
|
|
|
function updateFromServerThread(id) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let memberCount;
|
|
|
|
|
let memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != id) {
|
2026-10-01 14:13:23 +00:00
|
|
|
if (!(id.id in closure_4)) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const channel = ChannelStore.getChannel(id.id);
|
|
|
|
|
if (null != channel) {
|
|
|
|
|
if (ALL_CHANNEL_TYPES.has(channel.type)) {
|
2026-10-01 14:13:23 +00:00
|
|
|
if (!(channel.id in closure_4)) {
|
|
|
|
|
const obj = { guildId: null, parentId: null, memberCount, memberIdsPreview };
|
2026-09-18 19:45:33 +00:00
|
|
|
({ guild_id: obj.guildId, parent_id: obj.parentId, memberCount } = channel);
|
2026-10-01 14:13:23 +00:00
|
|
|
id = channel.id;
|
|
|
|
|
const tmp4 = closure_4;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (memberCount == null) {
|
|
|
|
|
memberCount = 0;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
memberIdsPreview = channel.memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (memberIdsPreview == null) {
|
|
|
|
|
memberIdsPreview = [];
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp4[id] = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (null != channel.memberCount) {
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_4[channel.id].memberCount = channel.memberCount;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (null != channel.memberIdsPreview) {
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_4[channel.id].memberIdsPreview = channel.memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
const ALL_CHANNEL_TYPES = ChannelRecord.ALL_CHANNEL_TYPES;
|
2026-10-01 14:13:23 +00:00
|
|
|
const React3 = {};
|
|
|
|
|
const Store = get_initializedDefault.Store;
|
2026-09-18 19:45:33 +00:00
|
|
|
class ThreadMembersStore extends Store {
|
2026-10-01 14:13:23 +00:00
|
|
|
initialize() {
|
|
|
|
|
this.waitFor(ChannelStore);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getMemberCount(arg0) {
|
|
|
|
|
let memberCount;
|
|
|
|
|
if (closure_4[arg0] != null) {
|
|
|
|
|
memberCount = tmp.memberCount;
|
|
|
|
|
}
|
|
|
|
|
if (memberCount == null) {
|
|
|
|
|
memberCount = null;
|
|
|
|
|
}
|
|
|
|
|
return memberCount;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getMemberIdsPreview(arg0) {
|
|
|
|
|
let memberIdsPreview;
|
|
|
|
|
if (closure_4[arg0] != null) {
|
|
|
|
|
memberIdsPreview = tmp.memberIdsPreview;
|
|
|
|
|
}
|
|
|
|
|
if (memberIdsPreview == null) {
|
|
|
|
|
memberIdsPreview = null;
|
|
|
|
|
}
|
|
|
|
|
return memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getInitialOverlayState() {
|
|
|
|
|
return closure_4;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
}
|
|
|
|
|
const prototype = ThreadMembersStore.prototype;
|
2026-09-18 19:45:33 +00:00
|
|
|
ThreadMembersStore.displayName = "ThreadMembersStore";
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj = {
|
2026-09-18 19:45:33 +00:00
|
|
|
CONNECTION_OPEN: function handleConnectionOpen(guilds) {
|
|
|
|
|
closure_4 = {};
|
|
|
|
|
guilds = guilds.guilds;
|
|
|
|
|
const item = guilds.forEach(updateFromGuild);
|
|
|
|
|
},
|
|
|
|
|
OVERLAY_INITIALIZE: function handleOverlayInitialize(threadMembers) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = {};
|
2026-09-18 19:45:33 +00:00
|
|
|
const merged = Object.assign(threadMembers.threadMembers);
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_4 = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
},
|
|
|
|
|
GUILD_CREATE: function handleGuildCreate(guild) {
|
|
|
|
|
const threads = guild.guild.threads;
|
|
|
|
|
if (threads != null) {
|
|
|
|
|
const item = threads.forEach(updateFromThread);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
GUILD_DELETE: function handleGuildDelete(guild) {
|
|
|
|
|
const id = guild.guild.id;
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = _modDef12;
|
|
|
|
|
closure_4 = obj.omitBy(closure_4, (guildId) => guildId.guildId === id);
|
2026-09-18 19:45:33 +00:00
|
|
|
},
|
|
|
|
|
CHANNEL_DELETE: function handleChannelDelete(channel) {
|
|
|
|
|
const id = channel.channel.id;
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = _modDef12;
|
|
|
|
|
closure_4 = obj.omitBy(closure_4, (parentId) => parentId.parentId === id);
|
2026-09-18 19:45:33 +00:00
|
|
|
},
|
|
|
|
|
THREAD_CREATE: handleThreadCreateOrUpdate,
|
|
|
|
|
THREAD_UPDATE: handleThreadCreateOrUpdate,
|
|
|
|
|
THREAD_LIST_SYNC: function handleThreadListSync(threads) {
|
|
|
|
|
threads = threads.threads;
|
|
|
|
|
const item = threads.forEach(updateFromThread);
|
|
|
|
|
},
|
|
|
|
|
THREAD_MEMBERS_UPDATE: function handleThreadMembersUpdate(memberIdsPreview) {
|
2026-10-01 14:13:23 +00:00
|
|
|
if (null == closure_4[memberIdsPreview.id]) {
|
2026-09-18 19:45:33 +00:00
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
if (null != memberIdsPreview.memberIdsPreview) {
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_4[memberIdsPreview.id].memberIdsPreview = memberIdsPreview.memberIdsPreview;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_4[memberIdsPreview.id].memberCount = memberIdsPreview.memberCount;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
SEARCH_MESSAGES_SUCCESS: handleSearchMessagesSuccess,
|
|
|
|
|
MOD_VIEW_SEARCH_MESSAGES_SUCCESS: handleSearchMessagesSuccess,
|
|
|
|
|
LOAD_THREADS_SUCCESS: handleLoadArchivedThreadsSuccess,
|
|
|
|
|
LOAD_ARCHIVED_THREADS_SUCCESS: handleLoadArchivedThreadsSuccess,
|
|
|
|
|
THREAD_DELETE: function handleThreadDelete(arg0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
delete closure_4[arg0.channel.id];
|
2026-09-18 19:45:33 +00:00
|
|
|
},
|
2026-10-01 14:13:23 +00:00
|
|
|
LOAD_MESSAGES_SUCCESS: function handleLoadMessagesSuccess(messages) {
|
2026-09-18 19:45:33 +00:00
|
|
|
let flag = false;
|
2026-10-01 14:13:23 +00:00
|
|
|
messages = messages.messages;
|
|
|
|
|
for (const item10007 of messages) {
|
|
|
|
|
let tmp2 = updateFromServerThread(item10007.thread) || flag;
|
|
|
|
|
flag = tmp2;
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
};
|
|
|
|
|
const threadMembersStore = new ThreadMembersStore(DispatcherDefault, obj);
|
2026-09-18 19:45:33 +00:00
|
|
|
const result = size.fileFinishedImporting("modules/threads/ThreadMembersStore.tsx");
|
|
|
|
|
|
|
|
|
|
export default threadMembersStore;
|