Fix message ID not being preserved during decoding

- Fixed BinaryProtocol to actually read and use the message ID
- Pass the decoded ID to BitchatMessage constructor
- This ensures ACKs reference the correct original message ID
This commit is contained in:
jack
2025-07-06 22:05:06 +02:00
parent 942913fb6d
commit 6a37c2cb0c
+2 -1
View File
@@ -376,7 +376,7 @@ extension BitchatMessage {
guard offset + idLength <= dataCopy.count else {
return nil
}
let _ = String(data: dataCopy[offset..<offset+idLength], encoding: .utf8) ?? UUID().uuidString
let id = String(data: dataCopy[offset..<offset+idLength], encoding: .utf8) ?? UUID().uuidString
offset += idLength
// Sender
@@ -476,6 +476,7 @@ extension BitchatMessage {
}
let message = BitchatMessage(
id: id,
sender: sender,
content: content,
timestamp: timestamp,