mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-10-18 07:33:01 +00:00
The private-media bit tells a sender we understand encrypted media. It says nothing about how much of it we can hold, so a sender has to infer the ceiling from the packet type — and that inference is wrong for this client. FragmentManager rejects any stream above MAX_FRAGMENTS_PER_ID whatever the type, while a sender that reads the bit as "large reassembler" plans far more than 256 fragments and sees no failure. Add TLV 0x03: a 2-byte big-endian count, optional, absent on every already-released client. An unreadable one (zero, wrong width, duplicated) is rejected rather than skipped like an unknown type — skipping reads as "said nothing", and "said nothing" is what sends the peer back to the guess. `local()` builds our own state so the two mesh services cannot drift and the advertised number is pinned to the constant the reassembler enforces.