From 43e73a5f24d085f9a8eb848ecc4f75499e372751 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: Thu, 24 Oct 2024 17:03:23 +0800 Subject: [PATCH 1/8] doc: big Logo --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b0c64730..69209608 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@
- NapCatQQ + + ![Logo](https://socialify.git.ci/NapNeko/NapCatQQ/image?font=Jost&logo=https%3A%2F%2Fnapneko.github.io%2Fassets%2Flogo.png&name=1&owner=1&pattern=Diagonal%20Stripes&stargazers=1&theme=Auto) +
--- From d5b7b3ae31d3810db77bf2c85c919e0fa2c09fdf 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: Thu, 24 Oct 2024 17:55:33 +0800 Subject: [PATCH 2/8] feat: ntappid --- src/core/external/appid.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/core/external/appid.json b/src/core/external/appid.json index 2d2f05f9..5dd23607 100644 --- a/src/core/external/appid.json +++ b/src/core/external/appid.json @@ -50,5 +50,13 @@ "9.9.16-28788": { "appid": 537249739, "qua": "V1_WIN_NQ_9.9.16_28788_GW_B" + }, + "9.9.16-28971":{ + "appid": 537249775, + "qua": "V1_WIN_NQ_9.9.16_28971_GW_B" + }, + "3.2.13-28971": { + "appid": 537249848, + "qua": "V1_LNX_NQ_3.2.13_28971_GW_B" } } \ No newline at end of file From 3c45c8bd8080854822292d378fac181302026a78 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: Thu, 24 Oct 2024 20:11:07 +0800 Subject: [PATCH 3/8] feat: 28971 --- src/core/external/offset.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/external/offset.json b/src/core/external/offset.json index 91c5983d..7d83efbd 100644 --- a/src/core/external/offset.json +++ b/src/core/external/offset.json @@ -19,8 +19,12 @@ "send": "A0CEC20", "recv": "A0D2520" }, - "3.2.13-28788-arm64":{ + "3.2.13-28788-arm64": { "send": "6E91018", "recv": "6E94850" + }, + "9.9.15-28971-x64": { + "send": "38079F0", + "recv": "380BE24" } } \ No newline at end of file From c790311fc3c4bd9056a563aa52f264bda873a061 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: Thu, 24 Oct 2024 20:11:39 +0800 Subject: [PATCH 4/8] release: v3.1.5 --- 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 1b814087..c9eac215 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "name": "NapCatQQ", "slug": "NapCat.Framework", "description": "高性能的 OneBot 11 协议实现", - "version": "3.1.4", + "version": "3.1.5", "icon": "./logo.png", "authors": [ { diff --git a/package.json b/package.json index d9132e18..b8020306 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "napcat", "private": true, "type": "module", - "version": "3.1.4", + "version": "3.1.5", "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 4235ff80..942b9be5 100644 --- a/src/common/version.ts +++ b/src/common/version.ts @@ -1 +1 @@ -export const napCatVersion = '3.1.4'; +export const napCatVersion = '3.1.5'; diff --git a/src/webui/ui/NapCat.ts b/src/webui/ui/NapCat.ts index 274792a7..f1e072db 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('V3.1.4', 'napcat-update-button', 'secondary'), + SettingButton('V3.1.5', 'napcat-update-button', 'secondary'), ), ]), SettingList([ diff --git a/static/assets/renderer.js b/static/assets/renderer.js index f2e95309..90ea8978 100644 --- a/static/assets/renderer.js +++ b/static/assets/renderer.js @@ -164,7 +164,7 @@ async function onSettingWindowCreated(view) { SettingItem( 'Napcat', void 0, - SettingButton("V3.1.4", "napcat-update-button", "secondary") + SettingButton("V3.1.5", "napcat-update-button", "secondary") ) ]), SettingList([ From 8569a451140111ddfbcd020a9dcdbec8dd2a6081 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: Thu, 24 Oct 2024 20:16:12 +0800 Subject: [PATCH 5/8] release: v3.1.5 --- src/core/external/offset.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/external/offset.json b/src/core/external/offset.json index 7d83efbd..aa032c44 100644 --- a/src/core/external/offset.json +++ b/src/core/external/offset.json @@ -23,7 +23,7 @@ "send": "6E91018", "recv": "6E94850" }, - "9.9.15-28971-x64": { + "9.9.16-28971-x64": { "send": "38079F0", "recv": "380BE24" } From 55542a3dbeb356fdb6e93cb2538ddae132aa2198 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: Thu, 24 Oct 2024 20:40:58 +0800 Subject: [PATCH 6/8] feat: 28971 Linux --- src/core/external/offset.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/external/offset.json b/src/core/external/offset.json index aa032c44..8cfdc411 100644 --- a/src/core/external/offset.json +++ b/src/core/external/offset.json @@ -26,5 +26,9 @@ "9.9.16-28971-x64": { "send": "38079F0", "recv": "380BE24" + }, + "3.2.13-28971-x64": { + "send": "A0CEF60", + "recv": "A0D2860" } } \ No newline at end of file From ab66904c1a52521d316adc37d7fe41cbcbfe1c1a 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: Thu, 24 Oct 2024 21:57:54 +0800 Subject: [PATCH 7/8] feat: 3.2.13-28971-arm64 --- src/core/external/offset.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/external/offset.json b/src/core/external/offset.json index 8cfdc411..f2f01f21 100644 --- a/src/core/external/offset.json +++ b/src/core/external/offset.json @@ -30,5 +30,9 @@ "3.2.13-28971-x64": { "send": "A0CEF60", "recv": "A0D2860" + }, + "3.2.12-28971-arm64": { + "send": "6E91318", + "recv": "6E94B50" } } \ No newline at end of file From 3612098d62b6850880007c9de50387f135977e9f Mon Sep 17 00:00:00 2001 From: Clansty Date: Fri, 25 Oct 2024 02:42:50 +0800 Subject: [PATCH 8/8] =?UTF-8?q?feat:=20=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E8=BD=AC=E5=8F=91=E5=A4=96=E6=98=BE=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/forward-msg-builder.ts | 44 ++++++++++++++++++++----------- src/onebot/action/msg/SendMsg.ts | 6 ++--- src/onebot/types/message.ts | 4 +++ 3 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/common/forward-msg-builder.ts b/src/common/forward-msg-builder.ts index bcd521b0..5a1629ef 100644 --- a/src/common/forward-msg-builder.ts +++ b/src/common/forward-msg-builder.ts @@ -50,9 +50,29 @@ interface ForwardAdaptMsgElement { } export class ForwardMsgBuilder { - private static build(resId: string, msg: ForwardAdaptMsg[]): ForwardMsgJson { + private static build(resId: string, msg: ForwardAdaptMsg[], source?: string, news?: ForwardMsgJsonMetaDetail["news"], summary?: string, prompt?: string): ForwardMsgJson { const id = crypto.randomUUID(); const isGroupMsg = msg.some(m => m.isGroupMsg); + if (!source) { + source = isGroupMsg ? "群聊的聊天记录" : + msg.length + ? Array.from(new Set(msg.map(m => m.senderName))) + .join('和') + '的聊天记录' + : '聊天记录'; + } + if (!news) { + news = msg.length === 0 ? [{ + text: "Nya~ This message is send from NapCat.Packet!", + }] : msg.map(m => ({ + text: `${m.senderName}: ${m.msg?.map(msg => msg.preview).join('')}`, + })); + } + if (!summary) { + summary = `查看${msg.length}条转发消息`; + } + if (!prompt) { + prompt = "[聊天记录]"; + } return { app: "com.tencent.multimsg", config: { @@ -62,29 +82,21 @@ export class ForwardMsgBuilder { type: "normal", width: 300 }, - desc: "[聊天记录]", + desc: prompt, extra: { filename: id, tsum: msg.length, }, meta: { detail: { - news: msg.length === 0 ? [{ - text: "Nya~ This message is send from NapCat.Packet!", - }] : msg.map(m => ({ - text: `${m.senderName}: ${m.msg?.map(msg => msg.preview).join('')}`, - })), + news, resid: resId, - source: isGroupMsg ? "群聊的聊天记录" : - msg.length - ? Array.from(new Set(msg.map(m => m.senderName))) - .join('和') + '的聊天记录' - : '聊天记录', - summary: `查看${msg.length}条转发消息`, + source, + summary, uniseq: id, } }, - prompt: "[聊天记录]", + prompt, ver: "0.0.0.5", view: "contact", }; @@ -94,13 +106,13 @@ export class ForwardMsgBuilder { return this.build(resId, []); } - static fromPacketMsg(resId: string, packetMsg: PacketMsg[]): ForwardMsgJson { + static fromPacketMsg(resId: string, packetMsg: PacketMsg[], source?: string, news?: ForwardMsgJsonMetaDetail["news"], summary?: string, prompt?: string): ForwardMsgJson { return this.build(resId, packetMsg.map(msg => ({ senderName: msg.senderName, isGroupMsg: msg.groupId !== undefined, msg: msg.msg.map(m => ({ preview: m.toPreview(), })) - }))); + })), source, news, summary, prompt); } } diff --git a/src/onebot/action/msg/SendMsg.ts b/src/onebot/action/msg/SendMsg.ts index eab2b2ae..0454cd16 100644 --- a/src/onebot/action/msg/SendMsg.ts +++ b/src/onebot/action/msg/SendMsg.ts @@ -117,7 +117,7 @@ export class SendMsg extends BaseAction { if (getSpecialMsgNum(payload, OB11MessageDataType.node)) { const packetMode = this.core.apis.PacketApi.available; const returnMsgAndResId = packetMode - ? await this.handleForwardedNodesPacket(peer, messages as OB11MessageNode[]) + ? await this.handleForwardedNodesPacket(peer, messages as OB11MessageNode[], payload.source, payload.news, payload.summary, payload.prompt) : await this.handleForwardedNodes(peer, messages as OB11MessageNode[]); if (returnMsgAndResId.message) { const msgShortId = MessageUnique.createUniqueMsgId({ @@ -146,7 +146,7 @@ export class SendMsg extends BaseAction { } // TODO: recursively handle forwarded nodes - private async handleForwardedNodesPacket(msgPeer: Peer, messageNodes: OB11MessageNode[]): Promise<{ + private async handleForwardedNodesPacket(msgPeer: Peer, messageNodes: OB11MessageNode[], source?: string, news?: { text: string }[], summary?: string, prompt?: string): Promise<{ message: RawMessage | null, res_id?: string }> { @@ -172,7 +172,7 @@ export class SendMsg extends BaseAction { } } const resid = await this.core.apis.PacketApi.sendUploadForwardMsg(packetMsg, msgPeer.chatType === ChatType.KCHATTYPEGROUP ? +msgPeer.peerUid : 0); - const forwardJson = ForwardMsgBuilder.fromPacketMsg(resid, packetMsg); + const forwardJson = ForwardMsgBuilder.fromPacketMsg(resid, packetMsg, source, news, summary, prompt); const finallySendElements = { elementType: ElementType.ARK, elementId: "", diff --git a/src/onebot/types/message.ts b/src/onebot/types/message.ts index d4890e34..8921afb3 100644 --- a/src/onebot/types/message.ts +++ b/src/onebot/types/message.ts @@ -221,6 +221,10 @@ export interface OB11PostSendMsg { message: OB11MessageMixType; messages?: OB11MessageMixType; // 兼容 go-cqhttp auto_escape?: boolean | string + source?: string, + news?: { text: string }[], + summary?: string, + prompt?: string } export interface OB11PostContext { message_type?: 'private' | 'group'