This commit is contained in:
手瓜一十雪
2026-10-30 14:59:39 +08:00
parent e8fbda4be6
commit 9335843246
+10 -8
View File
@@ -365,15 +365,17 @@ export class NapCatOneBot11Adapter {
msgListener.onAddSendMsg = async (msg) => { msgListener.onAddSendMsg = async (msg) => {
try { try {
if (msg.sendStatus === SendStatusType.KSEND_STATUS_SENDING) { if (msg.sendStatus === SendStatusType.KSEND_STATUS_SENDING) {
const [updatemsgs] = await this.core.eventWrapper.registerListen('NodeIKernelMsgListener/onMsgInfoListUpdate', (msgList: RawMessage[]) => { const isCompletedSend = (e: RawMessage) =>
const report = msgList.find((e) => e.senderUin === this.core.selfInfo.uin && e.msgId === msg.msgId &&
e.senderUin === this.core.selfInfo.uin && e.sendStatus !== SendStatusType.KSEND_STATUS_SENDING && e.msgId === msg.msgId (e.sendStatus === SendStatusType.KSEND_STATUS_SUCCESS || e.sendStatus === SendStatusType.KSEND_STATUS_FAILED);
); const [updatemsgs] = await this.core.eventWrapper.registerListen(
return !!report; 'NodeIKernelMsgListener/onMsgInfoListUpdate',
}, 1, 10 * 60 * 1000); (msgList: RawMessage[]) => msgList.some(isCompletedSend),
1,
10 * 60 * 1000
);
// 10分钟 超时 // 10分钟 超时
const updatemsg = updatemsgs.find((e) => e.msgId === msg.msgId); const updatemsg = updatemsgs.find(isCompletedSend);
// updatemsg?.sendStatus == SendStatusType.KSEND_STATUS_SUCCESS_NOSEQ NOSEQ一般是服务器未下发SEQ 这意味着这条消息不应该推送network
if (updatemsg?.sendStatus === SendStatusType.KSEND_STATUS_SUCCESS) { if (updatemsg?.sendStatus === SendStatusType.KSEND_STATUS_SUCCESS) {
updatemsg.id = MessageUnique.createUniqueMsgId( updatemsg.id = MessageUnique.createUniqueMsgId(
{ {