feat(onebot): expose bidirectional message history
Add reverse_order to group and private history actions, preserve latest-page behavior without an anchor, and keep local fallback results chronologically ordered. Key self-sent private messages and reply targets by the conversation peer, reject cross-conversation anchors, and include request context when a server fetch falls back to local history. Refs #229
This commit is contained in:
17 files changed
+468
-70
No files matched your search
@@ -441,7 +441,11 @@ export class OneBotInstance {
|
||||
if (messageId === 0) return;
|
||||
|
||||
const isGroup = event.message_type === 'group';
|
||||
const sessionId = isGroup ? toInt(event.group_id) : toInt(event.user_id);
|
||||
const sessionId = isGroup
|
||||
? toInt(event.group_id)
|
||||
: event.post_type === 'message_sent'
|
||||
? (toInt(event.target_id) || toInt(event.user_id))
|
||||
: toInt(event.user_id);
|
||||
const sequence = toInt(event.message_seq);
|
||||
const eventName = isGroup ? GROUP_MESSAGE_EVENT : PRIVATE_MESSAGE_EVENT;
|
||||
|
||||
|
||||
Reference in new issue
Block a user