mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-26 01:05:20 +00:00
Stable/verified private chats address a peer by its full 64-hex Noise key, but the Noise session, advertised capabilities, and connection state are keyed by the short (SHA256-derived 16-hex) routing ID. sendFilePrivate resolved the Wi-Fi bulk SendCandidate with the raw peerID, so a 64-hex key made hasEstablishedSession return false; shouldOffer never selected Wi-Fi and a >BLE-cap payload cancelled as "Wi-Fi unavailable" even when the direct peer advertised .wifiBulk. Normalize with peerID.toShort() once before the session/capability checks (extracted into wifiBulkSendCandidate) and use the normalized ID for the negotiation packet and the BLE fallback too. Test: eligibility + offer path resolves when addressed by a 64-hex Noise key — the session is established under the short ID, the raw-key lookup misses it, and the normalized send path still offers Wi-Fi. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>