mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-04 16:38:49 +00:00
WhatsApp can deliver a sender LID instead of a phone number. The channel already learns the LID->phone mapping at runtime, but only after a message that carries both values, so the first message from a contact can't be resolved to a phone number. Seed the mapping on startup from two sources: - reverse mapping files the bridge persists in the auth directory (lid-mapping-<lid>_reverse.json), resolved via get_runtime_subdir so it respects a custom runtime dir - a new optional channels.whatsapp.lidMappings config dict for static mappings (takes precedence over the on-disk files) Malformed/empty mapping files are ignored rather than failing startup. Adds tests for both sources, precedence, malformed files and the no-auth-dir case, plus docs for the new config field.