From c13c15d046400f37d640d8cfb41bf056b5741caf Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Sat, 7 Sep 2024 19:37:39 +0800 Subject: [PATCH 1/6] =?UTF-8?q?feat:=20=E5=85=81=E8=AE=B8=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E7=9A=84token=E8=87=AA=E5=8A=A8=E5=A1=AB=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/login.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/static/login.html b/static/login.html index 5ebbdd0b..58feb93b 100644 --- a/static/login.html +++ b/static/login.html @@ -29,7 +29,7 @@ margin-bottom: 20px; } - input[type="text"] { + input[type="password"] { width: 90%; padding: 10px; font-size: 16px; @@ -64,7 +64,7 @@
- +
@@ -133,4 +133,4 @@ - \ No newline at end of file + From ba097dad23e6ad3c86571bfe12eb5ec1d5bea085 Mon Sep 17 00:00:00 2001 From: Seijo Cecilia Date: Sat, 7 Sep 2024 19:49:18 +0800 Subject: [PATCH 2/6] update: recallMsgV2 --- src/core/apis/msg.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/core/apis/msg.ts b/src/core/apis/msg.ts index 1fd0c98a..a2d5cf56 100644 --- a/src/core/apis/msg.ts +++ b/src/core/apis/msg.ts @@ -164,6 +164,18 @@ export class NTQQMsgApi { }, msgIds); } + async recallMsgV2(peer: Peer, msgId: string) { + await this.core.eventWrapper.callNormalEventV2( + 'NodeIKernelMsgService/recallMsg', + 'NodeIKernelMsgListener/onMsgInfoListUpdate', + [peer, [msgId]], + () => true, + (updatedList) => updatedList.find(m => m.msgId === msgId && m.recallTime !== '0') !== undefined, + 1, + 1000, + ); + } + async PrepareTempChat(toUserUid: string, GroupCode: string, nickname: string) { return this.context.session.getMsgService().prepareTempChat({ chatType: ChatType.KCHATTYPETEMPC2CFROMGROUP, From 80facadd6780924f46016595435a2824906331de Mon Sep 17 00:00:00 2001 From: Seijo Cecilia Date: Sat, 7 Sep 2024 19:49:54 +0800 Subject: [PATCH 3/6] chore: fix prefer-const --- src/core/apis/msg.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/apis/msg.ts b/src/core/apis/msg.ts index a2d5cf56..e688ddcf 100644 --- a/src/core/apis/msg.ts +++ b/src/core/apis/msg.ts @@ -113,7 +113,7 @@ export class NTQQMsgApi { return await this.context.session.getMsgService().getMsgsBySeqList(peer, msgSeqList); } async getMsgBySeqExFirstMsg(peer: Peer, rootMsgId: string, replyMsgId: string) { - let reply = await this.context.session.getMsgService().getSourceOfReplyMsgV2(peer, rootMsgId, replyMsgId); + const reply = await this.context.session.getMsgService().getSourceOfReplyMsgV2(peer, rootMsgId, replyMsgId); console.log(reply); } async getMsgExBySeq(peer: Peer, msgSeq: string) { From 537d1c6f4fc1bc0fc13c96e2e3cd5daa6da70b8b Mon Sep 17 00:00:00 2001 From: Alen Date: Sat, 7 Sep 2024 19:54:01 +0800 Subject: [PATCH 4/6] =?UTF-8?q?fix:=20=E7=BE=A4=E6=88=90=E5=91=98=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复部分群成员列表返回为空的问题 --- src/core/apis/group.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/apis/group.ts b/src/core/apis/group.ts index 6d80090e..363483a4 100644 --- a/src/core/apis/group.ts +++ b/src/core/apis/group.ts @@ -292,7 +292,7 @@ export class NTQQGroupApi { const listener = this.core.eventWrapper.registerListen( 'NodeIKernelGroupListener/onMemberListChange', 1, - 500, + 5000, (params) => params.sceneId === sceneId, ); try { From 264cb6bbd2764e063aedda225dbbf4c76f996d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Sat, 7 Sep 2024 21:29:22 +0800 Subject: [PATCH 5/6] release: 2.3.7 --- manifest.json | 2 +- package.json | 2 +- src/common/version.ts | 2 +- src/webui/ui/NapCat.ts | 2 +- static/assets/renderer.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manifest.json b/manifest.json index 4523cbdb..864a3784 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "name": "NapCatQQ", "slug": "NapCat.Framework", "description": "高性能的 OneBot 11 协议实现", - "version": "2.3.6", + "version": "2.3.7", "icon": "./logo.png", "authors": [ { diff --git a/package.json b/package.json index 70258035..05e43347 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "napcat", "private": true, "type": "module", - "version": "2.3.6", + "version": "2.3.7", "scripts": { "build:framework": "vite build --mode framework", "build:shell": "vite build --mode shell", diff --git a/src/common/version.ts b/src/common/version.ts index 461338cf..6529bc59 100644 --- a/src/common/version.ts +++ b/src/common/version.ts @@ -1 +1 @@ -export const napCatVersion = '2.3.6'; +export const napCatVersion = '2.3.7'; diff --git a/src/webui/ui/NapCat.ts b/src/webui/ui/NapCat.ts index 3bd7b802..9e7ff663 100644 --- a/src/webui/ui/NapCat.ts +++ b/src/webui/ui/NapCat.ts @@ -30,7 +30,7 @@ async function onSettingWindowCreated(view: Element) { SettingItem( 'Napcat', undefined, - SettingButton('V2.3.6', 'napcat-update-button', 'secondary'), + SettingButton('V2.3.7', 'napcat-update-button', 'secondary'), ), ]), SettingList([ diff --git a/static/assets/renderer.js b/static/assets/renderer.js index f869c414..c9a08f20 100644 --- a/static/assets/renderer.js +++ b/static/assets/renderer.js @@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) { SettingItem( 'Napcat', void 0, - SettingButton("V2.3.6", "napcat-update-button", "secondary") + SettingButton("V2.3.7", "napcat-update-button", "secondary") ) ]), SettingList([ From 46729300376de9f0430302f1de59607b3582e11e Mon Sep 17 00:00:00 2001 From: "Wesley F. Young" Date: Sat, 7 Sep 2024 23:28:35 +0800 Subject: [PATCH 6/6] update: move to recallMsg(V2) --- src/core/apis/msg.ts | 9 +-------- src/onebot/action/msg/DeleteMsg.ts | 10 +--------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/core/apis/msg.ts b/src/core/apis/msg.ts index e688ddcf..e0294492 100644 --- a/src/core/apis/msg.ts +++ b/src/core/apis/msg.ts @@ -157,14 +157,7 @@ export class NTQQMsgApi { return this.context.session.getMsgService().getMsgsIncludeSelf(peer, msgId, count, isReverseOrder); } - async recallMsg(peer: Peer, msgIds: string[]) { - await this.context.session.getMsgService().recallMsg({ - chatType: peer.chatType, - peerUid: peer.peerUid, - }, msgIds); - } - - async recallMsgV2(peer: Peer, msgId: string) { + async recallMsg(peer: Peer, msgId: string) { await this.core.eventWrapper.callNormalEventV2( 'NodeIKernelMsgService/recallMsg', 'NodeIKernelMsgListener/onMsgInfoListUpdate', diff --git a/src/onebot/action/msg/DeleteMsg.ts b/src/onebot/action/msg/DeleteMsg.ts index b95004cb..d4c314d9 100644 --- a/src/onebot/action/msg/DeleteMsg.ts +++ b/src/onebot/action/msg/DeleteMsg.ts @@ -25,15 +25,7 @@ class DeleteMsg extends BaseAction { async _handle(payload: Payload) { const msg = MessageUnique.getMsgIdAndPeerByShortId(Number(payload.message_id)); if (msg) { - const ret = this.core.eventWrapper.registerListen( - 'NodeIKernelMsgListener/onMsgInfoListUpdate', - 1, - 1000, - (msgs) => !!msgs.find(m => m.msgId === msg.MsgId && m.recallTime !== '0'), - ).catch(() => undefined); - await this.core.apis.MsgApi.recallMsg(msg.Peer, [msg.MsgId]); - const data = await ret; - if (!data) throw new Error('Recall failed'); + await this.core.apis.MsgApi.recallMsg(msg.Peer, msg.MsgId); } else { throw new Error('Recall failed'); }