From 26b8a70a52f28404361091b0f7d22dd868dad80c Mon Sep 17 00:00:00 2001 From: xtao Date: Tue, 24 Feb 2026 19:09:36 +0800 Subject: [PATCH] fix(synology-chat): use finalizeInboundContext for proper normalization --- extensions/synology-chat/src/channel.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/synology-chat/src/channel.ts b/extensions/synology-chat/src/channel.ts index 7926b4597..2ce7e1c98 100644 --- a/extensions/synology-chat/src/channel.ts +++ b/extensions/synology-chat/src/channel.ts @@ -243,8 +243,8 @@ export function createSynologyChatPlugin() { const rt = getSynologyRuntime(); const currentCfg = await rt.config.loadConfig(); - // Build MsgContext (same format as LINE/Signal/etc.) - const msgCtx = { + // Build MsgContext using SDK's finalizeInboundContext for proper normalization + const msgCtx = rt.channel.reply.finalizeInboundContext({ Body: msg.body, RawBody: msg.body, CommandBody: msg.body, @@ -252,8 +252,8 @@ export function createSynologyChatPlugin() { To: `synology-chat:${msg.from}`, SessionKey: msg.sessionKey, AccountId: account.accountId, - OriginatingChannel: CHANNEL_ID as any, - OriginatingTo: msg.from, + OriginatingChannel: CHANNEL_ID, + OriginatingTo: `synology-chat:${msg.from}`, ChatType: msg.chatType, SenderName: msg.senderName, SenderId: msg.from, @@ -262,7 +262,7 @@ export function createSynologyChatPlugin() { ConversationLabel: msg.senderName || msg.from, Timestamp: Date.now(), CommandAuthorized: true, - }; + }); // Dispatch via the SDK's buffered block dispatcher await rt.channel.reply.dispatchReplyWithBufferedBlockDispatcher({