From 7e7457831238cc5e64b77efd250a5169193fa49c Mon Sep 17 00:00:00 2001 From: Alen Date: Sun, 15 Sep 2024 17:24:02 +0800 Subject: [PATCH 1/7] style --- src/onebot/api/msg.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index c8090c0b..919a51ae 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -629,7 +629,7 @@ export class OneBotMsgApi { if (element.grayTipElement.subElementType == NTGrayTipElementSubTypeV2.GRAYTIP_ELEMENT_SUBTYPE_XMLMSG) { //好友添加成功事件 if (element.grayTipElement.xmlElement.templId === '10229' && msg.peerUin !== '') { - return new OB11FriendAddNoticeEvent(this.core, parseInt(msg.peerUin) || Number(await this.core.apis.UserApi.getUinByUidV2(msg.peerUid))); + return new OB11FriendAddNoticeEvent(this.core, parseInt(msg.peerUin || await this.core.apis.UserApi.getUinByUidV2(msg.peerUid))); } } } From 8d6397028b262a770c40e499d4a77b45eed33685 Mon Sep 17 00:00:00 2001 From: Alen Date: Sun, 15 Sep 2024 17:31:01 +0800 Subject: [PATCH 2/7] Revert "style" This reverts commit 7e7457831238cc5e64b77efd250a5169193fa49c. --- src/onebot/api/msg.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index 919a51ae..c8090c0b 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -629,7 +629,7 @@ export class OneBotMsgApi { if (element.grayTipElement.subElementType == NTGrayTipElementSubTypeV2.GRAYTIP_ELEMENT_SUBTYPE_XMLMSG) { //好友添加成功事件 if (element.grayTipElement.xmlElement.templId === '10229' && msg.peerUin !== '') { - return new OB11FriendAddNoticeEvent(this.core, parseInt(msg.peerUin || await this.core.apis.UserApi.getUinByUidV2(msg.peerUid))); + return new OB11FriendAddNoticeEvent(this.core, parseInt(msg.peerUin) || Number(await this.core.apis.UserApi.getUinByUidV2(msg.peerUid))); } } } From 515a21761dc2640d98960159bcb3ff42a54df858 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: Mon, 16 Sep 2024 18:11:33 +0800 Subject: [PATCH 3/7] back: linux to 27254 --- src/common/helper.ts | 13 +++++++++++-- src/common/qq-basic-info.ts | 24 ++++++++++++------------ src/core/external/appid.json | 11 +++++++++++ 3 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/common/helper.ts b/src/common/helper.ts index c758c3a9..637fa803 100644 --- a/src/common/helper.ts +++ b/src/common/helper.ts @@ -163,8 +163,17 @@ export function isEqual(obj1: any, obj2: any) { export function getDefaultQQVersionConfigInfo(): QQVersionConfigType { if (os.platform() === 'linux') { return { - baseVersion: '3.2.12-27597', - curVersion: '3.2.12-27597', + baseVersion: '3.2.12.27254', + curVersion: '3.2.12.27254', + prevVersion: '', + onErrorVersions: [], + buildId: '27254', + }; + } + if (os.platform() === 'darwin') { + return { + baseVersion: '6.9.53.27597', + curVersion: '6.9.53.27597', prevVersion: '', onErrorVersions: [], buildId: '27597', diff --git a/src/common/qq-basic-info.ts b/src/common/qq-basic-info.ts index 4184902b..9d6aa50a 100644 --- a/src/common/qq-basic-info.ts +++ b/src/common/qq-basic-info.ts @@ -53,23 +53,23 @@ export class QQBasicInfoWrapper { //此方法不要直接使用 getQUAInternal() { switch (systemPlatform) { - case 'linux': - return `V1_LNX_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; - case 'darwin': - return `V1_MAC_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; - default: - return `V1_WIN_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; + case 'linux': + return `V1_LNX_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; + case 'darwin': + return `V1_MAC_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; + default: + return `V1_WIN_${this.getFullQQVesion()}_${this.getQQBuildStr()}_GW_B`; } } getAppidInternal() { switch (systemPlatform) { - case 'linux': - return '537243600'; - case 'darwin': - return '537243441'; - default: - return '537243538'; + case 'linux': + return '537240795'; + case 'darwin': + return '537243538'; + default: + return '537243441'; } } diff --git a/src/core/external/appid.json b/src/core/external/appid.json index 50d410db..cdc03108 100644 --- a/src/core/external/appid.json +++ b/src/core/external/appid.json @@ -1,4 +1,14 @@ { + + "3.2.12-27254":{ + "appid": 537240795, + "qua": "V1_LNX_NQ_3.2.12_27254_GW_B" + }, + "9.9.15-27254":{ + "appid": 537240709, + "qua": "V1_WIN_NQ_9.9.15_27254_GW_B" + }, + "3.2.12-27597": { "appid": 537243600, "qua": "V1_LNX_NQ_3.2.12_27597_GW_B" @@ -11,6 +21,7 @@ "appid": 537243538, "qua": "V1_MAC_NQ_6.9.53_27597_GW_B" }, + "9.9.15-28060":{ "appid": 537246092, "qua": "V1_WIN_NQ_9.9.15_28060_GW_B" From e9ede6924eea492c1d682749b83ae22a7e1f0a4e 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: Mon, 16 Sep 2024 18:12:00 +0800 Subject: [PATCH 4/7] release: 2.5.2 --- 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 91bb7bff..ba55d3f0 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "name": "NapCatQQ", "slug": "NapCat.Framework", "description": "高性能的 OneBot 11 协议实现", - "version": "2.5.1", + "version": "2.5.2", "icon": "./logo.png", "authors": [ { diff --git a/package.json b/package.json index d7248fe2..f784b22e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "napcat", "private": true, "type": "module", - "version": "2.5.1", + "version": "2.5.2", "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 60516350..75e68bff 100644 --- a/src/common/version.ts +++ b/src/common/version.ts @@ -1 +1 @@ -export const napCatVersion = '2.5.1'; +export const napCatVersion = '2.5.2'; diff --git a/src/webui/ui/NapCat.ts b/src/webui/ui/NapCat.ts index ef87090a..6e5b4416 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.5.1', 'napcat-update-button', 'secondary'), + SettingButton('V2.5.2', 'napcat-update-button', 'secondary'), ), ]), SettingList([ diff --git a/static/assets/renderer.js b/static/assets/renderer.js index fa3d67e8..2039e1f4 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.5.1", "napcat-update-button", "secondary") + SettingButton("V2.5.2", "napcat-update-button", "secondary") ) ]), SettingList([ From c145935d46c40c707827dceec482d76a3ed2fa51 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: Mon, 16 Sep 2024 18:47:51 +0800 Subject: [PATCH 5/7] feat: contact --- src/core/services/NodeIKernelBuddyService.ts | 2 +- src/onebot/api/msg.ts | 8 ++++++++ src/onebot/types/message.ts | 12 +++++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/core/services/NodeIKernelBuddyService.ts b/src/core/services/NodeIKernelBuddyService.ts index 9273d05d..ac96b5a3 100644 --- a/src/core/services/NodeIKernelBuddyService.ts +++ b/src/core/services/NodeIKernelBuddyService.ts @@ -114,7 +114,7 @@ export interface NodeIKernelBuddyService { reportDoubtBuddyReqUnread(): void; - getBuddyRecommendContactArkJson(uid: string, phoneNumber: string): Promise; + getBuddyRecommendContactArkJson(uid: string, phoneNumber: string): Promise; isNull(): boolean; } diff --git a/src/onebot/api/msg.ts b/src/onebot/api/msg.ts index c8090c0b..4f056038 100644 --- a/src/onebot/api/msg.ts +++ b/src/onebot/api/msg.ts @@ -607,6 +607,14 @@ export class OneBotMsgApi { }), [OB11MessageDataType.miniapp]: async () => undefined, + + [OB11MessageDataType.contact]: async ({ data }, context) => { + let arkJson = await this.core.apis.UserApi.getBuddyRecommendContactArkJson(data.qq, ''); + return this.ob11ToRawConverters.json({ + data: { data: arkJson.arkMsg }, + type: OB11MessageDataType.json + }, context); + } }; constructor(obContext: NapCatOneBot11Adapter, core: NapCatCore) { diff --git a/src/onebot/types/message.ts b/src/onebot/types/message.ts index bf2f3530..1386aa52 100644 --- a/src/onebot/types/message.ts +++ b/src/onebot/types/message.ts @@ -62,6 +62,7 @@ export enum OB11MessageDataType { dice = 'dice', RPS = 'rps', miniapp = 'miniapp',//json类 + contact = 'contact', Location = 'location' } @@ -81,10 +82,15 @@ export interface OB11MessageText { text: string, // 纯文本 } } - +export interface OB11MessageContext { + type: OB11MessageDataType.contact, + data: { + qq: string, + } +} export interface OB11MessageFileBase { data: { - file_unique?:string, + file_unique?: string, path?: string; thumb?: string; name?: string; @@ -198,7 +204,7 @@ export type OB11MessageData = OB11MessageAt | OB11MessageReply | OB11MessageImage | OB11MessageRecord | OB11MessageFile | OB11MessageVideo | OB11MessageNode | OB11MessageIdMusic | OB11MessageCustomMusic | OB11MessageJson | - OB11MessageDice | OB11MessageRPS | OB11MessageMarkdown | OB11MessageForward + OB11MessageDice | OB11MessageRPS | OB11MessageMarkdown | OB11MessageForward | OB11MessageContext export interface OB11PostSendMsg { message_type?: 'private' | 'group' From 1ff6ce2343958f5f52c57ef853fa24c8bcfbe9d5 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: Mon, 16 Sep 2024 18:51:05 +0800 Subject: [PATCH 6/7] feat: FetchOtherProfileLike --- src/onebot/action/extends/FetchOtherProfileLike.ts | 11 +++++++++++ src/onebot/action/index.ts | 2 ++ src/onebot/action/types.ts | 1 + 3 files changed, 14 insertions(+) create mode 100644 src/onebot/action/extends/FetchOtherProfileLike.ts diff --git a/src/onebot/action/extends/FetchOtherProfileLike.ts b/src/onebot/action/extends/FetchOtherProfileLike.ts new file mode 100644 index 00000000..820542fa --- /dev/null +++ b/src/onebot/action/extends/FetchOtherProfileLike.ts @@ -0,0 +1,11 @@ +import BaseAction from '../BaseAction'; +import { ActionName } from '../types'; + +export class FetchOtherProfileLike extends BaseAction<{ qq: number }, any> { + actionName = ActionName.FetchOtherProfileLike; + + async _handle(payload: { qq: number }) { + if (!payload.qq) throw new Error('qq is required'); + return await this.core.apis.UserApi.getUidByUinV2(payload.qq.toString()); + } +} diff --git a/src/onebot/action/index.ts b/src/onebot/action/index.ts index c55e9b0a..d8f1f13f 100644 --- a/src/onebot/action/index.ts +++ b/src/onebot/action/index.ts @@ -84,6 +84,7 @@ import { GetGroupFileSystemInfo } from '@/onebot/action/go-cqhttp/GetGroupFileSy import { GetGroupRootFiles } from '@/onebot/action/go-cqhttp/GetGroupRootFiles'; import { GetGroupFilesByFolder } from '@/onebot/action/go-cqhttp/GetGroupFilesByFolder'; import { GetGroupSystemMsg } from './system/GetSystemMsg'; +import { FetchOtherProfileLike } from './extends/fetchOtherProfileLike'; export type ActionMap = Map>; @@ -178,6 +179,7 @@ export function createActionMap(obContext: NapCatOneBot11Adapter, core: NapCatCo new GetGroupFileSystemInfo(obContext, core), new GetGroupFilesByFolder(obContext, core), new GetGroupSystemMsg(obContext, core), + new FetchOtherProfileLike(obContext, core), ]; const actionMap = new Map(); for (const action of actionHandlers) { diff --git a/src/onebot/action/types.ts b/src/onebot/action/types.ts index 54d8cd68..0cc7644a 100644 --- a/src/onebot/action/types.ts +++ b/src/onebot/action/types.ts @@ -118,4 +118,5 @@ export enum ActionName { DelGroupNotice = '_del_group_notice', GetGroupInfoEx = "get_group_info_ex", GetGroupSystemMsg = 'get_group_system_msg', + FetchOtherProfileLike = "fetch_other_profile_like", } From 73b6d3be84b8972706a782fc01d704dc51c39b43 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: Mon, 16 Sep 2024 18:51:26 +0800 Subject: [PATCH 7/7] release: 2.5.3 --- 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 ba55d3f0..2f8aa4d1 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "name": "NapCatQQ", "slug": "NapCat.Framework", "description": "高性能的 OneBot 11 协议实现", - "version": "2.5.2", + "version": "2.5.3", "icon": "./logo.png", "authors": [ { diff --git a/package.json b/package.json index f784b22e..57cc6eda 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "napcat", "private": true, "type": "module", - "version": "2.5.2", + "version": "2.5.3", "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 75e68bff..85b145aa 100644 --- a/src/common/version.ts +++ b/src/common/version.ts @@ -1 +1 @@ -export const napCatVersion = '2.5.2'; +export const napCatVersion = '2.5.3'; diff --git a/src/webui/ui/NapCat.ts b/src/webui/ui/NapCat.ts index 6e5b4416..c7deba23 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.5.2', 'napcat-update-button', 'secondary'), + SettingButton('V2.5.3', 'napcat-update-button', 'secondary'), ), ]), SettingList([ diff --git a/static/assets/renderer.js b/static/assets/renderer.js index 2039e1f4..51296347 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.5.2", "napcat-update-button", "secondary") + SettingButton("V2.5.3", "napcat-update-button", "secondary") ) ]), SettingList([