From f1027ec0d9c2d5fd93a174e273775b3a6d879664 Mon Sep 17 00:00:00 2001 From: idranme <96647698+idranme@users.noreply.github.com> Date: Thu, 24 Oct 2024 22:09:12 +0800 Subject: [PATCH] fix --- src/ntqqapi/core.ts | 2 +- src/ntqqapi/ntcall.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ntqqapi/core.ts b/src/ntqqapi/core.ts index d82f1a3..67cb801 100644 --- a/src/ntqqapi/core.ts +++ b/src/ntqqapi/core.ts @@ -197,8 +197,8 @@ class Core extends Service { recallMsgIds.push(msg.msgId) this.ctx.parallel('nt/message-deleted', msg) } else if (sentMsgIds.get(msg.msgId)) { - sentMsgIds.delete(msg.msgId) if (msg.sendStatus === 2) { + sentMsgIds.delete(msg.msgId) this.ctx.parallel('nt/message-sent', msg) } } diff --git a/src/ntqqapi/ntcall.ts b/src/ntqqapi/ntcall.ts index 87cdfae..0f27e30 100644 --- a/src/ntqqapi/ntcall.ts +++ b/src/ntqqapi/ntcall.ts @@ -1,6 +1,6 @@ import { ipcMain } from 'electron' import { hookApiCallbacks, registerReceiveHook, removeReceiveHook } from './hook' -import { log } from '../common/utils/legacyLog' +import { getBuildVersion, log } from '../common/utils' import { randomUUID } from 'node:crypto' import { GeneralCallResult, @@ -114,7 +114,7 @@ export function invoke< M extends keyof NTService[S] & string = any >(method: Extract | string, args: unknown[], options: InvokeOptions = {}) { const className = options.className ?? NTClass.NT_API - const channel = options.channel ?? NTChannel.IPC_UP_2 + const channel = options.channel ?? getBuildVersion() >= 28788 ? NTChannel.IPC_UP_3 : NTChannel.IPC_UP_2 const timeout = options.timeout ?? 5000 const afterFirstCmd = options.afterFirstCmd ?? true let eventName = className + '-' + channel[channel.length - 1]