diff --git a/packages/core/src/bridge/actions/extras.ts b/packages/core/src/bridge/actions/extras.ts index 38a082a0..3aca81ae 100644 --- a/packages/core/src/bridge/actions/extras.ts +++ b/packages/core/src/bridge/actions/extras.ts @@ -66,6 +66,9 @@ export async function getStrangerStatus(bridge: Bridge, uin: number): Promise ({ key: k })), }; + // Set OIDB envelope `reserved = 1` (the `isUid: true` flag — the + // name is historical, the wire semantic is "this is the UIN-form + // variant of the call"). Without it newer QQ NT versions take the + // UID-form validation path, find neither uid nor openid in the body + // and bounce the request with `[oidb] one of uid/openid is invaild`. + // Matches Lagrange.Core's FetchStrangerByUin (Reserved = 1). const resp = await runOidb(bridge, { cmd: 'OidbSvcTrpcTcp.0xfe1_2', oidbCmd: 0xFE1, subCmd: 2, - request: { schema: OidbUserInfoRequestSchema, value: body }, + request: { schema: OidbUserInfoRequestSchema, value: body, isUid: true }, response: { schema: OidbUserInfoResponseSchema }, }); diff --git a/packages/core/src/bridge/bridge-oidb.ts b/packages/core/src/bridge/bridge-oidb.ts index ac7d78c2..23e71579 100644 --- a/packages/core/src/bridge/bridge-oidb.ts +++ b/packages/core/src/bridge/bridge-oidb.ts @@ -20,10 +20,16 @@ export interface OidbCall { schema: ProtoSchema; value: any; /** - * Sets the OIDB envelope `reserved` field to 1 when true. A handful - * of commands (group/friend list, rkey download) operate on - * UID-keyed data and require this flag — the wire format is - * otherwise identical. + * Sets the OIDB envelope `reserved` field to 1 when true. + * + * The name is historical and misleading: empirically (see Lagrange + * FetchStrangerByUin vs FetchStrangerByUid, fetchGroupList, our own + * highway uploads) the `reserved = 1` flag indicates the UIN-form + * variant of an OIDB call — it tells newer QQ NT to translate the + * UIN in the body to an internal UID rather than running the + * UID-form validator that expects a uid/openid string in the body. + * + * Omit (default false) for genuinely UID-keyed calls. */ isUid?: boolean; };