fix(onebot): correct private message history (#256)

Use the C2C roam cursor and canonical NT sequence for bidirectional history. Persist direction-aware recall tombstones so recalled messages cannot reappear.
This commit is contained in:
DrSmoothl committed 2026-07-20 22:25:13 +08:00
1 parent 88216ce644
commit 4aa2cd1693
37 files changed
+1853 -242

No files matched your search

+2 -2
View File
@@ -339,7 +339,7 @@ export const actions = [
defineAction({
name: 'get_friend_msg_history',
summary: '获取好友消息历史',
summary: '获取好友消息历史(无锚点时从服务器获取最新双向记录)',
readOnly: true,
returns: '{ messages }:好友消息事件对象数组(每项为 OneBot 消息事件,内部字段不固定)。',
returnsSchema: {
@@ -353,7 +353,7 @@ export const actions = [
user_id: f.userId(),
// Signed int32 hash, frequently negative — see get_group_msg_history.
message_id: f.int().default(0).role('message_id'),
count: f.int({ min: 0 }).default(20),
count: f.int({ min: 0 }).default(20).describe('无锚点时从 QQ 服务器获取最新双向历史;服务器或身份解析失败时动作失败,不返回不完整的本地缓存'),
reverse_order: f.bool().default(true).describe('仅在 message_id 非 0 时生效;true 返回锚点及更旧消息,false 返回锚点及更新消息'),
},
run: async (p, ctx) => {