fix: preserve whatsapp group JIDs

This commit is contained in:
Peter Steinberger
2025-12-23 03:05:59 +01:00
parent fc4a395c88
commit 4af08b1606
5 changed files with 30 additions and 4 deletions

View File

@@ -54,7 +54,9 @@ export function isSelfChatMode(
}
export function toWhatsappJid(number: string): string {
const e164 = normalizeE164(number);
const withoutPrefix = number.replace(/^whatsapp:/, "").trim();
if (withoutPrefix.includes("@")) return withoutPrefix;
const e164 = normalizeE164(withoutPrefix);
const digits = e164.replace(/\D/g, "");
return `${digits}@s.whatsapp.net`;
}