mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-25 09:45:18 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user