diff --git a/packages/core/tests/msg-push-handler.test.ts b/packages/core/tests/msg-push-handler.test.ts index 5b1efd09..b3128296 100644 --- a/packages/core/tests/msg-push-handler.test.ts +++ b/packages/core/tests/msg-push-handler.test.ts @@ -322,15 +322,16 @@ describe('parseMsgPush Event0x210 subType=39 (profile like → 名片赞)', () = } it('emits friend_profile_like with liker uin, nick and parsed count', () => { + // txt shape taken from a real capture: "赞了我的资料卡N次". const [event] = parseMsgPush( - makeLikePacket({ uin: 1787882683, nick: '東雪蓮', txt: '赞了你3次' }), + makeLikePacket({ uin: 1206069534, nick: '墨白灵MotricLuck', txt: '赞了我的资料卡2次' }), makeIdentity(), ) as FriendProfileLikeEvent[]; expect(event.kind).toBe('friend_profile_like'); - expect(event.operatorUin).toBe(1787882683); - expect(event.operatorNick).toBe('東雪蓮'); - expect(event.times).toBe(3); + expect(event.operatorUin).toBe(1206069534); + expect(event.operatorNick).toBe('墨白灵MotricLuck'); + expect(event.times).toBe(2); expect(event.time).toBe(1710001111); }); diff --git a/packages/proto-defs/src/notify.ts b/packages/proto-defs/src/notify.ts index 443dac2e..f106a46b 100644 --- a/packages/proto-defs/src/notify.ts +++ b/packages/proto-defs/src/notify.ts @@ -284,9 +284,9 @@ export interface GroupSpecialTitleChange { // Profile-like ("名片赞") notify — Event 0x210 subType 39, whose body.msgContent // decodes as this ProfileLikeTip. subType 39 is multiplexed; only inner -// msgType==0 && subType==203 is a like. NOTE: proto shape sourced from NapCat's -// raw-bytes decoder (adaptDecoder.ts) — semantics only; pending a real like -// capture to confirm byte-exactly. times is parsed from `detail.txt`. +// msgType==0 && subType==203 is a like. Field numbers CONFIRMED byte-exact against +// real on-wire captures (detail.txt = "赞了我的资料卡N次", f3=liker uin, f5=nick); +// the like count is parsed from `detail.txt`. export interface ProfileLikeDetail { txt?: pb<1, string>; uin?: pb<3, uint_64>; diff --git a/packages/protocol/src/msg-push/decoders/event-0x210.ts b/packages/protocol/src/msg-push/decoders/event-0x210.ts index 047c41c7..acc3ffb5 100644 --- a/packages/protocol/src/msg-push/decoders/event-0x210.ts +++ b/packages/protocol/src/msg-push/decoders/event-0x210.ts @@ -165,8 +165,8 @@ function inputStatusText(eventType: number): string { // subType 39 is multiplexed; body.msgContent decodes as ProfileLikeTip and is a // profile-like ("名片赞") only when inner msgType==0 && subType==203. Other 39 // variants (multi-device sync etc.) decode to a non-matching tip → dropped. -// `times` is the like count parsed out of `detail.txt`. Proto shape from NapCat's -// raw-bytes decoder — pending a real like capture to validate byte-exactly. +// `times` is the like count parsed out of `detail.txt` ("赞了我的资料卡N次"). +// Field layout confirmed byte-exact against real on-wire captures. function decodeProfileLike(ctx: MsgPushContext): QQEventVariant[] { const tip = protobuf_decode(ctx.content); // msgType 0 is the proto default → omitted on the wire → decodes as undefined,