decord/source/modules/replies/PendingReplyStore.tsx

182 lines
5.9 KiB
TypeScript
Raw Normal View History

// Module ID: 7788
// Function ID: 7789
// Name: PendingReplyStore
// Dependencies: [32, 1958, 4859, 11, 504, 573, 2]
2026-07-20 16:05:17 +00:00
// Module 7788 (PendingReplyStore)
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
import initializeDefault from "initialize" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 573 */;
import _slicedToArray from "module_32" /* 32 */;
import ChannelStore from "ChannelStore" /* 1958 */;
import MessageStore from "MessageStore" /* 4859 */;
2026-07-23 10:11:24 +00:00
const dependencyMap = {};
const dependencyMap2 = {};
2026-07-29 08:29:29 +00:00
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() {
const obj = {};
const entries = SnowflakeUtilsDefault.entries(closure_5);
2026-07-29 08:29:29 +00:00
while (tmp2 !== undefined) {
let tmp5 = _slicedToArray(tmp3, 2);
2026-07-29 08:29:29 +00:00
[tmp6, tmp7] = tmp5;
let obj4 = { channelId: tmp6, messageId: tmp7.message.id, shouldMention: null, showMentionToggle: null };
({ shouldMention: obj3.shouldMention, showMentionToggle: obj3.showMentionToggle } = tmp7);
obj[tmp6] = obj4;
2026-07-29 08:29:29 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const merged = Object.assign(closure_6);
const merged1 = Object.assign(obj);
return {};
2026-07-29 08:29:29 +00:00
};
prototype["initialize"] = function initialize(arg0) {
let obj = arg0;
this.waitFor(MessageStore, ChannelStore);
2026-07-29 08:29:29 +00:00
if (arg0 == null) {
obj = {};
2026-07-20 16:05:17 +00:00
}
closure_6 = obj;
2026-07-29 08:29:29 +00:00
};
prototype["getPendingReply"] = function getPendingReply(id) {
return dependencyMap[id];
};
prototype["getPendingReplyActionSource"] = function getPendingReplyActionSource(c0) {
return closure_7[c0];
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;
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) {
const 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) {
const obj2 = {};
2026-07-23 10:11:24 +00:00
const merged1 = Object.assign(dependencyMap2[channelId]);
obj2.shouldMention = shouldMention;
dependencyMap2[channelId] = obj2;
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() {
const keys = SnowflakeUtilsDefault.keys(closure_6);
const item = keys.forEach((item) => {
if (null == channel.getChannel(item)) {
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);
let id1;
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) {
id1 = message.id;
2026-07-20 16:05:17 +00:00
}
}
if (id1 === 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 = MessageStore.getMessage(channelId, tmp4.messageId);
const channel = ChannelStore.getChannel(tmp4.channelId);
2026-07-29 08:29:29 +00:00
if (null != message) {
if (null != channel) {
const obj = { channel, message, shouldMention: null, showMentionToggle: null };
({ shouldMention: obj.shouldMention, showMentionToggle: obj.showMentionToggle } = tmp4);
2026-07-29 08:29:29 +00:00
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 = MessageStore.getMessage(channelId, tmp4.messageId);
const channel = ChannelStore.getChannel(tmp4.channelId);
2026-07-29 08:29:29 +00:00
if (null != message) {
if (null != channel) {
const obj = { channel, message, shouldMention: null, showMentionToggle: null };
({ shouldMention: obj.shouldMention, showMentionToggle: obj.showMentionToggle } = tmp4);
2026-07-29 08:29:29 +00:00
closure_5[channelId] = obj;
delete tmp[tmp2];
}
}
}
}
2026-07-20 16:05:17 +00:00
}
});
const size = fn(2);
const result = size.fileFinishedImporting("modules/replies/PendingReplyStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default pendingReplyStore;