From 1070278eafcee6ac646c3c9e2e617027ba53833d 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: Tue, 6 Aug 2024 09:13:03 +0800 Subject: [PATCH] release: 1.8.0 --- docs/changelogs/CHANGELOG.v1.7.9.md | 2 +- package.json | 2 +- src/common/utils/MessageUnique.ts | 6 ++++-- src/onebot11/version.ts | 2 +- src/webui/ui/NapCat.ts | 2 +- static/assets/renderer.js | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/changelogs/CHANGELOG.v1.7.9.md b/docs/changelogs/CHANGELOG.v1.7.9.md index 6eb49b66..cb2a0840 100644 --- a/docs/changelogs/CHANGELOG.v1.7.9.md +++ b/docs/changelogs/CHANGELOG.v1.7.9.md @@ -1,4 +1,4 @@ -# v1.7.9 +# v1.8.0 QQ Version: Windows 9.9.15-26702 / Linux 3.2.12-26702 diff --git a/package.json b/package.json index 587fbf4a..27c68093 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "napcat", "private": true, "type": "module", - "version": "1.7.9", + "version": "1.8.0", "scripts": { "watch:dev": "vite --mode development", "watch:prod": "vite --mode production", diff --git a/src/common/utils/MessageUnique.ts b/src/common/utils/MessageUnique.ts index 004000fc..54fc3571 100644 --- a/src/common/utils/MessageUnique.ts +++ b/src/common/utils/MessageUnique.ts @@ -99,8 +99,10 @@ class MessageUniqueWrapper { } createMsg(peer: Peer, msgId: string): number | undefined { const key = `${msgId}|${peer.chatType}|${peer.peerUid}`; - const hash = crypto.createHash('md5').update(key); - const shortId = hash.digest().readUInt32BE(0); + const hash = crypto.createHash('md5').update(key).digest(); + //设置第一个bit为0 保证shortId为正数 + hash[0] &= 0x7f; + const shortId = hash.readInt32BE(0); //减少性能损耗 // const isExist = this.msgIdMap.getKey(shortId); // if (isExist && isExist === msgId) { diff --git a/src/onebot11/version.ts b/src/onebot11/version.ts index 3b6b0d94..2bbf678a 100644 --- a/src/onebot11/version.ts +++ b/src/onebot11/version.ts @@ -1 +1 @@ -export const version = '1.7.9'; +export const version = '1.8.0'; diff --git a/src/webui/ui/NapCat.ts b/src/webui/ui/NapCat.ts index 7499a3e6..02a17fbd 100644 --- a/src/webui/ui/NapCat.ts +++ b/src/webui/ui/NapCat.ts @@ -29,7 +29,7 @@ async function onSettingWindowCreated(view: Element) { SettingItem( 'Napcat', undefined, - SettingButton('V1.7.9', 'napcat-update-button', 'secondary') + SettingButton('V1.8.0', 'napcat-update-button', 'secondary') ), ]), SettingList([ diff --git a/static/assets/renderer.js b/static/assets/renderer.js index ff1be992..cf93aa41 100644 --- a/static/assets/renderer.js +++ b/static/assets/renderer.js @@ -163,7 +163,7 @@ async function onSettingWindowCreated(view) { SettingItem( 'Napcat', void 0, - SettingButton("V1.7.9", "napcat-update-button", "secondary") + SettingButton("V1.8.0", "napcat-update-button", "secondary") ) ]), SettingList([