decord/source/stores/EditMessageStore.tsx

125 lines
3.7 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 7286
// Function ID: 7287
2026-07-29 08:29:29 +00:00
// Name: initialize
2026-08-25 06:04:03 +00:00
// Dependencies: [4623, 4070, 7287, 7290, 589, 709, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 7286 (initialize)
2026-08-24 06:08:38 +00:00
import initializeDefault from "initialize" /* 589 */;
import dispatcherDefault from "dispatcher" /* 709 */;
2026-08-25 06:04:03 +00:00
import explicitContentFromProto from "explicitContentFromProto" /* 4070 */;
import rebuildDefault from "rebuild" /* 7287 */;
import createEmptyState from "createEmptyState" /* 7290 */;
import closure_3 from "reinjectEphemerals" /* 4623 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
let closure_4 = {};
let closure_5 = {};
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class EditMessageStore extends Store {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = EditMessageStore.prototype;
prototype["initialize"] = function initialize() {
2026-08-24 06:08:38 +00:00
this.waitFor(closure_3);
2026-07-29 08:29:29 +00:00
};
prototype["isEditing"] = function isEditing(arg0, arg1) {
let messageId;
if (dependencyMap[arg0] != null) {
messageId = tmp.messageId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return messageId === arg1;
};
prototype["isEditingAny"] = function isEditingAny(arg0) {
return null != dependencyMap[arg0];
};
prototype["getEditingTextValue"] = function getEditingTextValue(id) {
let textValue;
if (dependencyMap[id] != null) {
textValue = tmp.textValue;
}
return textValue;
};
prototype["getEditingRichValue"] = function getEditingRichValue(arg0) {
let richValue;
if (dependencyMap[arg0] != null) {
richValue = tmp.richValue;
}
return richValue;
};
prototype["getEditingMessageId"] = function getEditingMessageId(memo1) {
let messageId;
if (dependencyMap[memo1] != null) {
messageId = tmp.messageId;
}
return messageId;
};
prototype["getEditingMessage"] = function getEditingMessage(id) {
let message = null;
if (null != dependencyMap[id]) {
message = null;
if (null != tmp.messageId) {
message = message.getMessage(id, tmp.messageId);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
return message;
};
2026-08-24 06:08:38 +00:00
prototype["getEditActionSource"] = function getEditActionSource(closure_1_0) {
return table[closure_1_0];
2026-07-29 08:29:29 +00:00
};
EditMessageStore.displayName = "EditMessageStore";
2026-08-24 06:08:38 +00:00
const editMessageStore = new EditMessageStore(dispatcherDefault, {
2026-07-20 16:05:17 +00:00
MESSAGE_START_EDIT: function handleMessageStartEdit(arg0) {
({ channelId, content } = arg0);
({ messageId, source } = arg0);
2026-08-24 06:08:38 +00:00
const UseLegacyChatInput = explicitContentFromProto.UseLegacyChatInput;
2026-07-20 16:05:17 +00:00
const setting = UseLegacyChatInput.getSetting();
2026-08-24 06:08:38 +00:00
let obj = rebuildDefault;
2026-07-20 16:05:17 +00:00
const unparseResult = obj.unparse(content, channelId);
2026-07-29 08:29:29 +00:00
obj = { channelId, messageId, textValue: unparseResult, richValue: null };
2026-07-20 16:05:17 +00:00
if (setting) {
content = unparseResult;
}
2026-08-24 06:08:38 +00:00
obj[3] = createEmptyState.toRichValue(content);
2026-07-29 08:29:29 +00:00
closure_4[channelId] = obj;
closure_5[channelId] = source;
2026-07-20 16:05:17 +00:00
},
MESSAGE_UPDATE_EDIT: function handleMessageUpdateEdit(channelId) {
channelId = channelId.channelId;
2026-07-23 10:11:24 +00:00
if (null == dependencyMap[channelId]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
const obj = {};
const merged = Object.assign(tmp3);
2026-07-29 08:29:29 +00:00
obj.textValue = tmp;
obj.richValue = tmp2;
2026-07-23 10:11:24 +00:00
dependencyMap[channelId] = obj;
2026-07-20 16:05:17 +00:00
}
},
MESSAGE_END_EDIT: function handleMessageEndEdit(channelId) {
channelId = channelId.channelId;
if (null != channelId) {
2026-07-23 10:11:24 +00:00
if (null != dependencyMap[channelId]) {
delete tmp3[tmp2];
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
}
return false;
},
MESSAGE_DELETE: function handleMessageDelete(id) {
let messageId;
2026-07-29 08:29:29 +00:00
if (dependencyMap[id.channelId] != null) {
2026-07-23 10:11:24 +00:00
messageId = tmp4.messageId;
2026-07-20 16:05:17 +00:00
}
if (messageId === id.id) {
2026-07-23 10:11:24 +00:00
delete tmp3[tmp2];
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
},
LOGOUT: function handleLogout() {
2026-08-24 06:08:38 +00:00
closure_4 = {};
closure_5 = {};
2026-07-20 16:05:17 +00:00
}
});
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("stores/EditMessageStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default editMessageStore;