decord/stable/source/stores/EditMessageStore.tsx

135 lines
3.7 KiB
TypeScript
Raw Permalink Normal View History

2026-10-06 22:12:49 +00:00
// Module ID: 7098
// Function ID: 7099
// Name: EditMessageStore
2026-10-06 22:12:49 +00:00
// Dependencies: [5057, 2027, 7099, 7103, 504, 585, 2]
2026-10-06 22:12:49 +00:00
// Module 7098 (EditMessageStore)
import get_initializedDefault from "get initialized" /* 504 */;
import DispatcherDefault from "Dispatcher" /* 585 */;
import UserSettings from "UserSettings" /* 2027 */;
import MessageParserDefault from "MessageParser" /* 7099 */;
import SlateUtils from "SlateUtils" /* 7103 */;
import MessageStore from "MessageStore" /* 5057 */;
import size from "module_2" /* 2 */;
2026-10-06 22:12:49 +00:00
let closure_4, closure_5;
const React3 = {};
const hasOwnProperty = {};
const Store = get_initializedDefault.Store;
class EditMessageStore extends Store {
2026-10-06 22:12:49 +00:00
initialize() {
this.waitFor(MessageStore);
}
2026-10-06 22:12:49 +00:00
isEditing(arg0, arg1) {
let messageId;
if (closure_4[arg0] != null) {
messageId = tmp.messageId;
}
return messageId === arg1;
}
2026-10-06 22:12:49 +00:00
isEditingAny(arg0) {
return null != closure_4[arg0];
}
2026-10-06 22:12:49 +00:00
getEditingTextValue(id) {
let textValue;
if (closure_4[id] != null) {
textValue = tmp.textValue;
}
return textValue;
}
2026-10-06 22:12:49 +00:00
getEditingRichValue(arg0) {
let richValue;
if (closure_4[arg0] != null) {
richValue = tmp.richValue;
}
2026-10-06 22:12:49 +00:00
return richValue;
}
2026-10-06 22:12:49 +00:00
getEditingMessageId(id) {
let messageId;
if (closure_4[id] != null) {
messageId = tmp.messageId;
}
return messageId;
}
getEditingMessage(id) {
let message = null;
if (null != closure_4[id]) {
message = null;
if (null != closure_4[id].messageId) {
message = MessageStore.getMessage(id, tmp.messageId);
}
}
return message;
}
getEditActionSource(channel_id) {
return closure_5[channel_id];
}
}
const prototype = EditMessageStore.prototype;
EditMessageStore.displayName = "EditMessageStore";
2026-10-06 22:12:49 +00:00
let obj = {
MESSAGE_START_EDIT: function handleMessageStartEdit(arg0) {
2026-10-06 22:12:49 +00:00
let channelId;
let content;
let messageId;
let source;
let toRichValue;
({ channelId, content } = arg0);
({ messageId, source } = arg0);
const UseLegacyChatInput = UserSettings.UseLegacyChatInput;
const setting = UseLegacyChatInput.getSetting();
2026-10-06 22:12:49 +00:00
const obj = MessageParserDefault;
const unparseResult = obj.unparse(content, channelId);
const obj2 = { channelId, messageId, textValue: unparseResult, richValue: toRichValue(content) };
toRichValue = SlateUtils.toRichValue;
SlateUtils;
const tmp3 = closure_4;
if (setting) {
content = unparseResult;
}
tmp3[channelId] = obj2;
closure_5[channelId] = source;
},
MESSAGE_UPDATE_EDIT: function handleMessageUpdateEdit(channelId) {
channelId = channelId.channelId;
2026-10-06 22:12:49 +00:00
if (null == closure_4[channelId]) {
return false;
} else {
2026-10-06 22:12:49 +00:00
const obj = { textValue: tmp, richValue: tmp2 };
const merged = Object.assign(tmp3);
2026-10-06 22:12:49 +00:00
closure_4[channelId] = obj;
}
},
MESSAGE_END_EDIT: function handleMessageEndEdit(channelId) {
channelId = channelId.channelId;
if (null != channelId) {
2026-10-06 22:12:49 +00:00
if (null != closure_4[channelId]) {
delete closure_4[channelId];
delete closure_5[channelId];
}
}
return false;
},
2026-10-06 22:12:49 +00:00
MESSAGE_DELETE: function handleMessageDelete(channelId) {
channelId = channelId.channelId;
let messageId;
2026-10-06 22:12:49 +00:00
const id = channelId.id;
if (closure_4[channelId] != null) {
messageId = tmp.messageId;
}
2026-10-06 22:12:49 +00:00
if (messageId === id) {
delete closure_4[channelId];
delete closure_5[channelId];
}
},
LOGOUT: function handleLogout() {
closure_4 = {};
closure_5 = {};
}
2026-10-06 22:12:49 +00:00
};
const editMessageStore = new EditMessageStore(DispatcherDefault, obj);
const result = size.fileFinishedImporting("stores/EditMessageStore.tsx");
export default editMessageStore;