mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-07-26 08:05:21 +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 {
|
guard offset + idLength <= dataCopy.count else {
|
||||||
return nil
|
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
|
offset += idLength
|
||||||
|
|
||||||
// Sender
|
// Sender
|
||||||
@@ -476,6 +476,7 @@ extension BitchatMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let message = BitchatMessage(
|
let message = BitchatMessage(
|
||||||
|
id: id,
|
||||||
sender: sender,
|
sender: sender,
|
||||||
content: content,
|
content: content,
|
||||||
timestamp: timestamp,
|
timestamp: timestamp,
|
||||||
|
|||||||
Reference in New Issue
Block a user