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
@@ -19,6 +19,7 @@ import { PkgType } from './enums';
|
||||
import { MsgPushRegistry } from './registry';
|
||||
|
||||
export { SSO_GET_GROUP_MSG_CMD, fetchGroupMessageRange } from './fetch-group-history';
|
||||
export { SSO_GET_C2C_MSG_CMD, fetchC2cMessageRange } from './fetch-c2c-history';
|
||||
|
||||
export const MSG_PUSH_CMD = 'trpc.msg.olpush.OlPushService.MsgPush';
|
||||
|
||||
|
||||
Reference in new issue
Block a user