2026-09-16 07:03:15 +00:00
|
|
|
// Module ID: 16963
|
|
|
|
|
// Function ID: 16964
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: useOnMessageSend
|
2026-09-05 10:56:28 +00:00
|
|
|
// Dependencies: [19, 1074, 573, 2]
|
2026-07-20 16:05:17 +00:00
|
|
|
// Exports: default
|
|
|
|
|
|
2026-09-16 07:03:15 +00:00
|
|
|
// Module 16963 (useOnMessageSend)
|
2026-09-10 05:38:07 +00:00
|
|
|
import DispatcherDefault from "Dispatcher" /* 573 */;
|
|
|
|
|
import noop from "module_19" /* 19 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
const MessageStates = fn(1074).MessageStates;
|
|
|
|
|
const size = fn(2);
|
|
|
|
|
const result = size.fileFinishedImporting("modules/messages/useOnMessageSend.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
|
|
|
|
export default function useOnMessageSend(arg0) {
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_0 = arg0;
|
2026-09-10 05:38:07 +00:00
|
|
|
dependencyMap = tmp;
|
2026-07-20 16:05:17 +00:00
|
|
|
const items = [arg0, arg1];
|
2026-09-10 05:38:07 +00:00
|
|
|
const effect = noop.useEffect(() => {
|
2026-07-20 16:05:17 +00:00
|
|
|
function handleMessage(channelId) {
|
2026-07-29 08:29:29 +00:00
|
|
|
let tmp2 = undefined !== handleMessageCreate;
|
|
|
|
|
if (tmp2) {
|
|
|
|
|
tmp2 = channelId.channelId !== tmp;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
if (!tmp2) {
|
2026-07-20 16:05:17 +00:00
|
|
|
handleMessage();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function handleMessageCreate(optimistic) {
|
|
|
|
|
optimistic = optimistic.optimistic;
|
|
|
|
|
if (!optimistic) {
|
2026-09-10 05:38:07 +00:00
|
|
|
optimistic = optimistic.message.state === constants.SENDING;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
if (optimistic) {
|
2026-07-29 08:29:29 +00:00
|
|
|
if (!tmp3) {
|
|
|
|
|
handleMessage();
|
|
|
|
|
}
|
|
|
|
|
tmp3 = undefined !== handleMessageCreate && optimistic.channelId !== tmp2;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
const subscription = closure_0(573).subscribe("MESSAGE_CREATE", handleMessageCreate);
|
|
|
|
|
let obj = closure_0(573);
|
|
|
|
|
const subscription1 = closure_0(573).subscribe("UPLOAD_START", handleMessage);
|
|
|
|
|
let obj2 = closure_0(573);
|
|
|
|
|
const subscription2 = closure_0(573).subscribe("CALL_CREATE", handleMessage);
|
2026-07-20 16:05:17 +00:00
|
|
|
return () => {
|
2026-09-10 05:38:07 +00:00
|
|
|
DispatcherDefault.unsubscribe("MESSAGE_CREATE", handleMessageCreate);
|
|
|
|
|
DispatcherDefault.unsubscribe("UPLOAD_START", handleMessage);
|
|
|
|
|
DispatcherDefault.unsubscribe("CALL_CREATE", handleMessage);
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|
|
|
|
|
}, items);
|
|
|
|
|
};
|