From 463e0ffb5dbee2fb5f4fa615c32a366318944ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E7=91=BE?= Date: Sat, 16 May 2026 14:22:49 +0800 Subject: [PATCH] fix(send): keep c2c video compatQMsgSceneType at 2 (#38) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 29f28d6 changed c2c video `compatQmsgSceneType` from 2 to 1 as a "symmetric asymmetry" cleanup, matching the image/ptt convention where the field tracks the upload's sceneType (c2c=1, group=2). For video this is wrong. Image and ptt have *different* legacy compat elements per scene (notOnlineImage vs customFace; ptt c2c vs group), so the server needs to know which scene shape to emit. The legacy `videoFile` element (packet element type 19) has no scene split — fromChatType / toChatType live inside the element itself — so the QQ NT server emits a single group-shaped compat payload regardless. NapCat hardcodes `compatQMsgSceneType: 2` for *both* UploadGroupVideo and UploadPrivateVideo for exactly this reason. Setting it to 1 on c2c made the server emit a c2c-scene shaped compat blob that older QQ clients failed to resolve, showing the message as "视频已过期" on those receivers. Newer clients only read the commonElem(48, 11) and displayed fine — which is why only "some devices" saw the breakage. Keep `commonElem.businessType = isGroup ? 21 : 11` untouched — that piece of 29f28d6 is still correct and is what fixed PbSendMsg result=79. --- packages/core/src/bridge/highway/video-upload.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/core/src/bridge/highway/video-upload.ts b/packages/core/src/bridge/highway/video-upload.ts index b8990ce3..5ed36be3 100644 --- a/packages/core/src/bridge/highway/video-upload.ts +++ b/packages/core/src/bridge/highway/video-upload.ts @@ -487,11 +487,17 @@ export async function uploadVideoMsgInfo( subFileType: 100, }, ], - // Scene tag the NTV2 upload registers under. image-upload and - // ptt-upload both differentiate (group=2, c2c=1); video was - // hardcoded to the group value, which contributed to the c2c - // send-back rejection (PbSendMsg result=79). - compatQmsgSceneType: isGroup ? 2 : 1, + // Hardcoded 2 even on c2c (matches NapCat). Image/PTT use + // `isGroup ? 2 : 1` because their legacy compat elements differ + // per scene (notOnlineImage vs customFace; ptt c2c vs group), + // but the legacy `videoFile` element has no scene split — its + // fromChatType/toChatType live inside the element itself — so + // the server generates a single group-shaped compat payload + // regardless. Setting 1 here makes the server emit a c2c-scene + // shaped compat blob that old QQ clients fail to resolve, + // showing the message as "视频已过期" on those receivers while + // new clients (which only read the commonElem) display fine. + compatQmsgSceneType: 2, extBizInfo: { pic: { bizType: 0, textSummary: 'Nya~' }, video: { bytesPbReserve: new Uint8Array([0x80, 0x01, 0x00]) },