|
|
@ -1,7 +1,7 @@
|
|
|
|
export function normalizeUserIdentifier(input: string): string {
|
|
|
|
export function normalizeUserIdentifier(input: string): string {
|
|
|
|
// Handle JID format (12345678@s.whatsapp.net)
|
|
|
|
// Handle JID format (12345678@s.whatsapp.net)
|
|
|
|
if (input.includes('@s.whatsapp.net')) {
|
|
|
|
if (input.includes('@s.whatsapp.net')) {
|
|
|
|
return `@${input.split('@')[0]}`;
|
|
|
|
return input; // Return full JID
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Remove @ prefix if present
|
|
|
|
// Remove @ prefix if present
|
|
|
@ -15,7 +15,7 @@ export function normalizeUserIdentifier(input: string): string {
|
|
|
|
throw new Error('Número de teléfono inválido');
|
|
|
|
throw new Error('Número de teléfono inválido');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return `@${phoneNumber}`;
|
|
|
|
return `${phoneNumber}@s.whatsapp.net`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export function extractUserFromJid(jid: string): string {
|
|
|
|
export function extractUserFromJid(jid: string): string {
|
|
|
|