Files
lettabot/src/pairing
Parth Modi d8d140fa71 fix: normalize WhatsApp phone numbers for consistent pairing (#61)
- Add normalizePhoneForStorage() utility to handle @lid, @s.whatsapp.net suffixes
- Strip @lid/@s.whatsapp.net/@g.us and normalize to E.164 format (+prefix)
- Fix pairing approval format mismatch causing re-prompts for approved contacts
- Normalize userId on extraction, storage, and access checks

Fixes issue where approved contacts get pairing codes on every message
due to format inconsistencies:
- Extracted: 54941422981120@lid
- Checked: +54941422981120@lid
- Stored: 54941422981120@lid
- No match!

Now all formats normalize to: +54941422981120
2026-02-01 20:29:27 -08:00
..