mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 22:34:32 +00:00
fix(synology-chat): use finalizeInboundContext for proper normalization
This commit is contained in:
@@ -243,8 +243,8 @@ export function createSynologyChatPlugin() {
|
|||||||
const rt = getSynologyRuntime();
|
const rt = getSynologyRuntime();
|
||||||
const currentCfg = await rt.config.loadConfig();
|
const currentCfg = await rt.config.loadConfig();
|
||||||
|
|
||||||
// Build MsgContext (same format as LINE/Signal/etc.)
|
// Build MsgContext using SDK's finalizeInboundContext for proper normalization
|
||||||
const msgCtx = {
|
const msgCtx = rt.channel.reply.finalizeInboundContext({
|
||||||
Body: msg.body,
|
Body: msg.body,
|
||||||
RawBody: msg.body,
|
RawBody: msg.body,
|
||||||
CommandBody: msg.body,
|
CommandBody: msg.body,
|
||||||
@@ -252,8 +252,8 @@ export function createSynologyChatPlugin() {
|
|||||||
To: `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,
|
||||||
OriginatingTo: msg.from,
|
OriginatingTo: `synology-chat:${msg.from}`,
|
||||||
ChatType: msg.chatType,
|
ChatType: msg.chatType,
|
||||||
SenderName: msg.senderName,
|
SenderName: msg.senderName,
|
||||||
SenderId: msg.from,
|
SenderId: msg.from,
|
||||||
@@ -262,7 +262,7 @@ export function createSynologyChatPlugin() {
|
|||||||
ConversationLabel: msg.senderName || msg.from,
|
ConversationLabel: msg.senderName || msg.from,
|
||||||
Timestamp: Date.now(),
|
Timestamp: Date.now(),
|
||||||
CommandAuthorized: true,
|
CommandAuthorized: true,
|
||||||
};
|
});
|
||||||
|
|
||||||
// Dispatch via the SDK's buffered block dispatcher
|
// Dispatch via the SDK's buffered block dispatcher
|
||||||
await rt.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
|
await rt.channel.reply.dispatchReplyWithBufferedBlockDispatcher({
|
||||||
|
|||||||
Reference in New Issue
Block a user