mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 13:27:39 +00:00
feat: make inbound envelopes configurable
Co-authored-by: Shiva Prasad <shiv19@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import { resolveMessagePrefix } from "../../../agents/identity.js";
|
||||
import { formatInboundEnvelope } from "../../../auto-reply/envelope.js";
|
||||
import {
|
||||
formatInboundEnvelope,
|
||||
type EnvelopeFormatOptions,
|
||||
} from "../../../auto-reply/envelope.js";
|
||||
import type { loadConfig } from "../../../config/config.js";
|
||||
import type { WebInboundMsg } from "../types.js";
|
||||
|
||||
@@ -14,8 +17,10 @@ export function buildInboundLine(params: {
|
||||
cfg: ReturnType<typeof loadConfig>;
|
||||
msg: WebInboundMsg;
|
||||
agentId: string;
|
||||
previousTimestamp?: number;
|
||||
envelope?: EnvelopeFormatOptions;
|
||||
}) {
|
||||
const { cfg, msg, agentId } = params;
|
||||
const { cfg, msg, agentId, previousTimestamp, envelope } = params;
|
||||
// WhatsApp inbound prefix: channels.whatsapp.messagePrefix > legacy messages.messagePrefix > identity/defaults
|
||||
const messagePrefix = resolveMessagePrefix(cfg, agentId, {
|
||||
configured: cfg.channels?.whatsapp?.messagePrefix,
|
||||
@@ -37,5 +42,7 @@ export function buildInboundLine(params: {
|
||||
e164: msg.senderE164,
|
||||
id: msg.senderJid,
|
||||
},
|
||||
previousTimestamp,
|
||||
envelope,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user