decord/source/modules/replies/PendingReplyStore.tsx

189 lines
6 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 7285
// Function ID: 7286
2026-07-29 08:29:29 +00:00
// Name: getState
2026-08-25 06:04:03 +00:00
// Dependencies: [32, 1391, 4623, 11, 589, 709, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 7285 (getState)
2026-08-24 06:08:38 +00:00
import DISCORD_EPOCHDefault from "DISCORD_EPOCH" /* 11 */;
import initializeDefault from "initialize" /* 589 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import closure_2 from "_slicedToArray" /* 32 */;
import closure_3 from "ensureGuildLoaded" /* 1391 */;
2026-08-25 06:04:03 +00:00
import closure_4 from "reinjectEphemerals" /* 4623 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let closure_5 = {};
let closure_6 = {};
let closure_7 = {};
2026-08-24 06:08:38 +00:00
const PersistedStore = initializeDefault.PersistedStore;
2026-07-29 08:29:29 +00:00
class PendingReplyStore extends PersistedStore {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = PendingReplyStore.prototype;
prototype["getState"] = function getState() {
let obj = {};
2026-08-24 06:08:38 +00:00
const entries = DISCORD_EPOCHDefault.entries(closure_5);
const obj2 = DISCORD_EPOCHDefault;
2026-07-29 08:29:29 +00:00
while (tmp2 !== undefined) {
let tmp4 = callback;
let tmp5 = callback(tmp3, 2);
[tmp6, tmp7] = tmp5;
obj = { channelId: null, messageId: null, shouldMention: null, showMentionToggle: null };
obj[0] = tmp6;
obj[1] = tmp7.message.id;
({ shouldMention: obj3[2], showMentionToggle: obj3[3] } = tmp7);
obj[tmp6] = obj;
continue;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = {};
const merged = Object.assign(closure_6);
const merged1 = Object.assign(obj);
return obj;
};
prototype["initialize"] = function initialize(arg0) {
let obj = arg0;
2026-08-24 06:08:38 +00:00
this.waitFor(closure_4, closure_3);
2026-07-29 08:29:29 +00:00
if (arg0 == null) {
obj = {};
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
};
prototype["getPendingReply"] = function getPendingReply(id) {
return dependencyMap[id];
};
2026-08-03 11:20:01 +00:00
prototype["getPendingReplyActionSource"] = function getPendingReplyActionSource(pendingReplyActionSource) {
return table[pendingReplyActionSource];
2026-07-29 08:29:29 +00:00
};
PendingReplyStore.displayName = "PendingReplyStore";
PendingReplyStore.persistKey = "PendingReplyStore";
const items = [
2026-07-20 16:05:17 +00:00
(arg0) => {
let obj = arg0;
2026-07-29 08:29:29 +00:00
if (arg0 == null) {
2026-07-20 16:05:17 +00:00
obj = {};
}
return obj;
}
];
2026-07-29 08:29:29 +00:00
PendingReplyStore.migrations = items;
2026-08-24 06:08:38 +00:00
const pendingReplyStore = new PendingReplyStore(dispatcherDefault, {
2026-07-20 16:05:17 +00:00
CREATE_PENDING_REPLY: function handleCreatePendingReply(message) {
({ channel, shouldMention } = message);
if (shouldMention === undefined) {
shouldMention = true;
}
let flag = message.showMentionToggle;
if (flag === undefined) {
flag = true;
}
2026-07-29 08:29:29 +00:00
closure_5[channel.id] = { channel, message: message.message, shouldMention, showMentionToggle: flag, mediaMention: message.mediaMention };
closure_7[channel.id] = message.source;
2026-07-20 16:05:17 +00:00
},
CREATE_SHALLOW_PENDING_REPLY: function handleCreateShallowPendingReply(messageId) {
({ channel, shouldMention } = messageId);
if (shouldMention === undefined) {
shouldMention = true;
}
let flag = messageId.showMentionToggle;
if (flag === undefined) {
flag = true;
}
2026-07-29 08:29:29 +00:00
closure_6[channel.id] = { channelId: channel.id, messageId: messageId.messageId, shouldMention, showMentionToggle: flag };
2026-07-20 16:05:17 +00:00
},
SET_PENDING_REPLY_SHOULD_MENTION: function handleSetPendingReplyShouldMention(arg0) {
({ channelId, shouldMention } = arg0);
2026-07-23 10:11:24 +00:00
if (channelId in dependencyMap) {
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-23 10:11:24 +00:00
const merged = Object.assign(dependencyMap[channelId]);
2026-07-29 08:29:29 +00:00
obj.shouldMention = shouldMention;
2026-07-23 10:11:24 +00:00
dependencyMap[channelId] = obj;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (channelId in dependencyMap2) {
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-23 10:11:24 +00:00
const merged1 = Object.assign(dependencyMap2[channelId]);
2026-07-29 08:29:29 +00:00
obj.shouldMention = shouldMention;
2026-07-23 10:11:24 +00:00
dependencyMap2[channelId] = obj;
2026-07-20 16:05:17 +00:00
}
},
DELETE_PENDING_REPLY: function handleDeletePendingReply(arg0) {
2026-07-23 10:11:24 +00:00
delete tmp3[tmp2];
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
},
CONNECTION_OPEN: function handleConnectionOpen() {
2026-08-24 06:08:38 +00:00
const keys = DISCORD_EPOCHDefault.keys(closure_6);
2026-07-29 08:29:29 +00:00
const item = keys.forEach((arg0) => {
if (null == channel.getChannel(arg0)) {
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
});
},
LOGOUT: function handleLogout() {
2026-08-24 06:08:38 +00:00
closure_5 = {};
closure_6 = {};
closure_7 = {};
2026-07-20 16:05:17 +00:00
},
MESSAGE_DELETE: function handleMessageDelete(arg0) {
({ id, channelId } = arg0);
id = undefined;
2026-07-29 08:29:29 +00:00
if (dependencyMap[channelId] != null) {
2026-07-23 10:11:24 +00:00
const message = tmp4.message;
2026-07-29 08:29:29 +00:00
if (message != null) {
2026-07-20 16:05:17 +00:00
id = message.id;
}
}
if (id === id) {
2026-07-23 10:11:24 +00:00
delete tmp3[tmp2];
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
} else {
let messageId;
2026-07-29 08:29:29 +00:00
if (dependencyMap2[channelId] != null) {
2026-07-23 10:11:24 +00:00
messageId = tmp7.messageId;
2026-07-20 16:05:17 +00:00
}
if (messageId !== id) {
return false;
} else {
2026-07-23 10:11:24 +00:00
delete tmp3[tmp2];
delete tmp3[tmp2];
2026-07-20 16:05:17 +00:00
}
}
},
CHANNEL_SELECT: function handleChannelSelect(channelId) {
2026-07-29 08:29:29 +00:00
channelId = channelId.channelId;
if (null != channelId) {
if (null != dependencyMap2[channelId]) {
const message = store2.getMessage(channelId, tmp4.messageId);
const channel = store.getChannel(tmp4.channelId);
if (null != message) {
if (null != channel) {
const obj = { channel: null, message: null, shouldMention: null, showMentionToggle: null };
obj[0] = channel;
obj[1] = message;
({ shouldMention: obj[2], showMentionToggle: obj[3] } = tmp4);
closure_5[channelId] = obj;
delete tmp[tmp2];
}
}
}
}
2026-07-20 16:05:17 +00:00
},
LOAD_MESSAGES_SUCCESS: function handleLoadMessagesSuccess(channelId) {
2026-07-29 08:29:29 +00:00
channelId = channelId.channelId;
if (null != channelId) {
if (null != dependencyMap2[channelId]) {
const message = store2.getMessage(channelId, tmp4.messageId);
const channel = store.getChannel(tmp4.channelId);
if (null != message) {
if (null != channel) {
const obj = { channel: null, message: null, shouldMention: null, showMentionToggle: null };
obj[0] = channel;
obj[1] = message;
({ shouldMention: obj[2], showMentionToggle: obj[3] } = tmp4);
closure_5[channelId] = obj;
delete tmp[tmp2];
}
}
}
}
2026-07-20 16:05:17 +00:00
}
});
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/replies/PendingReplyStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default pendingReplyStore;