fix(onebot): distinguish private poke conversations
Preserve the private conversation peer separately from the poke sender and target. Emit NapCat-compatible user_id and sender_id fields while keeping group notices unchanged. Add MsgPush and event-converter regression coverage for self-pokes across multiple friend sessions. Fixes #285.
This commit is contained in:
7 files changed
+126
-13
No files matched your search
@@ -286,12 +286,12 @@ describe('formatEvent', () => {
|
||||
.toBe('群戳 [Grp(1)] | [Alice(100)] -> [Bob(200)]');
|
||||
});
|
||||
|
||||
it('renders friend_poke without group context', () => {
|
||||
it('renders friend_poke with its private peer and both endpoints', () => {
|
||||
expect(formatEvent(id, {
|
||||
kind: 'friend_poke',
|
||||
userUin: 500, targetUin: 600,
|
||||
peerUin: 500, senderUin: 600, targetUin: 500,
|
||||
} as QQEventVariant))
|
||||
.toBe('戳一戳 [FriendA(500)] -> [FriendB(600)]');
|
||||
.toBe('私聊戳 [FriendA(500)] | [FriendB(600)] -> [FriendA(500)]');
|
||||
});
|
||||
|
||||
it('degrades to numeric IDs when nothing is cached', () => {
|
||||
|
||||
Reference in new issue
Block a user