fix(synology-chat): add missing context fields for message delivery

This commit is contained in:
xtao
2026-02-24 19:03:26 +08:00
committed by Peter Steinberger
parent e513714103
commit e391646043

View File

@@ -246,14 +246,22 @@ export function createSynologyChatPlugin() {
// Build MsgContext (same format as LINE/Signal/etc.) // Build MsgContext (same format as LINE/Signal/etc.)
const msgCtx = { const msgCtx = {
Body: msg.body, Body: msg.body,
From: msg.from, RawBody: msg.body,
To: account.botName, CommandBody: msg.body,
From: `synology-chat:${msg.from}`,
To: `synology-chat:${msg.from}`,
SessionKey: msg.sessionKey, SessionKey: msg.sessionKey,
AccountId: account.accountId, AccountId: account.accountId,
OriginatingChannel: CHANNEL_ID as any, OriginatingChannel: CHANNEL_ID as any,
OriginatingTo: msg.from, OriginatingTo: msg.from,
ChatType: msg.chatType, ChatType: msg.chatType,
SenderName: msg.senderName, SenderName: msg.senderName,
SenderId: msg.from,
Provider: CHANNEL_ID,
Surface: CHANNEL_ID,
ConversationLabel: msg.senderName || msg.from,
Timestamp: Date.now(),
CommandAuthorized: true,
}; };
// Dispatch via the SDK's buffered block dispatcher // Dispatch via the SDK's buffered block dispatcher