fragmented packets inherit route

This commit is contained in:
callebtc
2026-01-09 16:05:27 +07:00
parent a74e587123
commit fe441f8a0f
@@ -98,13 +98,16 @@ class FragmentManager {
) )
// iOS: MessageType.fragment.rawValue (single fragment type) // iOS: MessageType.fragment.rawValue (single fragment type)
// Fix: Fragments must inherit source route and use v2 if routed
val fragmentPacket = BitchatPacket( val fragmentPacket = BitchatPacket(
version = if (packet.route != null) 2u else 1u,
type = MessageType.FRAGMENT.value, type = MessageType.FRAGMENT.value,
ttl = packet.ttl, ttl = packet.ttl,
senderID = packet.senderID, senderID = packet.senderID,
recipientID = packet.recipientID, recipientID = packet.recipientID,
timestamp = packet.timestamp, timestamp = packet.timestamp,
payload = fragmentPayload.encode(), payload = fragmentPayload.encode(),
route = packet.route,
signature = null // iOS: signature: nil signature = null // iOS: signature: nil
) )