fix(auto-reply): default whatsapp self-only on empty config
This commit is contained in:
@@ -853,6 +853,11 @@ export async function getReplyFromConfig(
|
|||||||
: undefined;
|
: undefined;
|
||||||
const from = (ctx.From ?? "").replace(/^whatsapp:/, "");
|
const from = (ctx.From ?? "").replace(/^whatsapp:/, "");
|
||||||
const to = (ctx.To ?? "").replace(/^whatsapp:/, "");
|
const to = (ctx.To ?? "").replace(/^whatsapp:/, "");
|
||||||
|
const isEmptyConfig = Object.keys(cfg).length === 0;
|
||||||
|
if (isWhatsAppSurface && isEmptyConfig && from && to && from !== to) {
|
||||||
|
cleanupTyping();
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
const defaultAllowFrom =
|
const defaultAllowFrom =
|
||||||
isWhatsAppSurface &&
|
isWhatsAppSurface &&
|
||||||
(!configuredAllowFrom || configuredAllowFrom.length === 0) &&
|
(!configuredAllowFrom || configuredAllowFrom.length === 0) &&
|
||||||
|
|||||||
Reference in New Issue
Block a user