fix: preserve whatsapp group JIDs
This commit is contained in:
1 parent
fc4a395c88
commit
4af08b1606
5 files changed
+30
-4
No files matched your search
+3
-1
@@ -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`;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user