feat(onebot): fetch real private (c2c) history from server (#99)
Mirror the group-history fetch for private chats via SsoGetC2cMsg (trpc.msg.register_proxy.RegisterProxy.SsoGetC2cMsg, fields per Lagrange: flat friendUid/start/end request, messages@7 response). get_friend_msg_history now resolves the anchor sequence + the friend's UID, fetches real history from the server, converts + persists each message, and falls back to the local store on unknown anchor / no uid / empty / error. - protocol: fetchC2cMessageRange (decodes via the friend decoder). - core: the group + c2c fetch now share a generic walkBackHistory loop (same throttle gate + caps); added MessageApi.getC2cHistory. - onebot: getFriendHistory + a generalized persistHistoryEvent (keys private by sender uin, exactly like the live path — so reply to old private messages resolves too). Tests: SsoGetC2cMsg request/response round-trip + friend-decode reuse.
This commit is contained in:
9 files changed
+288
-41
No files matched your search
@@ -35,6 +35,10 @@
|
||||
"types": "./src/get-group-msg.ts",
|
||||
"default": "./src/get-group-msg.ts"
|
||||
},
|
||||
"./get-c2c-msg": {
|
||||
"types": "./src/get-c2c-msg.ts",
|
||||
"default": "./src/get-c2c-msg.ts"
|
||||
},
|
||||
"./notify": {
|
||||
"types": "./src/notify.ts",
|
||||
"default": "./src/notify.ts"
|
||||
|
||||
Reference in new issue
Block a user